diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 63caa988..83e0cb56 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -15,7 +15,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] - framework: [net8.0, net9.0] + framework: [net8.0, net9.0, net10.0] include: - framework: net8.0 @@ -24,18 +24,19 @@ jobs: - framework: net9.0 dotnetVersion: "9.0.x" + - framework: net10.0 + dotnetVersion: "10.0.x" + steps: - uses: actions/checkout@v5 - - name: Setup dotnet 8.0.x + - name: Setup dotnet uses: actions/setup-dotnet@v5 with: - dotnet-version: 8.0.x - - - name: Setup dotnet 9.0.x - uses: actions/setup-dotnet@v5 - with: - dotnet-version: 9.0.x + dotnet-version: | + 8.0.x + 9.0.x + 10.0.x - name: restore run: dotnet restore @@ -43,38 +44,44 @@ jobs: - name: build run: dotnet build --configuration Release --no-restore - - name: test - run: dotnet test ./tests/NuGetUtility.Test/NuGetUtility.Test.csproj --configuration Release -f ${{ matrix.framework }} --no-restore + - name: test (NuGetUtility.Test.dll) + run: dotnet test --project ./tests/NuGetUtility.Test/NuGetUtility.Test.csproj --configuration Release -f ${{ matrix.framework }} --no-restore --no-build - - name: test - run: dotnet test ./tests/NuGetLicense.Test/NuGetLicense.Test.csproj --configuration Release -f ${{ matrix.framework }} --no-restore + - name: test (NuGetLicense.Test.dll) + run: dotnet test --project ./tests/NuGetLicense.Test/NuGetLicense.Test.csproj --configuration Release -f ${{ matrix.framework }} --no-restore --no-build - test_file-license-matching: + test_file_license_matching: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v5 - - name: Setup dotnet 9.0.x + + - name: Setup dotnet uses: actions/setup-dotnet@v5 with: - dotnet-version: 9.0.x + dotnet-version: | + 9.0.x + 10.0.x - name: restore run: dotnet restore - name: test - run: dotnet test ./tests/SPDXLicenseMatcher.Test/SPDXLicenseMatcher.Test.csproj --configuration Release --no-restore + run: dotnet test --project ./tests/SPDXLicenseMatcher.Test/SPDXLicenseMatcher.Test.csproj --configuration Release --no-restore test_url_to_license_mapping: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - name: Setup dotnet 9.0.x + + - name: Setup dotnet uses: actions/setup-dotnet@v5 with: - dotnet-version: 9.0.x + dotnet-version: | + 9.0.x + 10.0.x - uses: browser-actions/setup-chrome@v2.1.0 @@ -82,47 +89,35 @@ jobs: run: dotnet restore - name: test - run: dotnet test ./tests/NuGetUtility.Test.UrlToLicenseMapping/NuGetUtility.Test.UrlToLicenseMapping.csproj --configuration Release --no-restore + run: dotnet test --project ./tests/NuGetUtility.Test.UrlToLicenseMapping/NuGetUtility.Test.UrlToLicenseMapping.csproj --configuration Release --no-restore test_windows: runs-on: windows-latest strategy: matrix: - framework: [net8.0, net472, net9.0] - - include: - - framework: net8.0 - dotnetVersion: "8.0.x" - - - framework: net9.0 - dotnetVersion: "9.0.x" + framework: [net8.0, net472, net9.0, net10.0] steps: - uses: actions/checkout@v5 - - name: Setup dotnet 8.0.x - uses: actions/setup-dotnet@v5 - with: - dotnet-version: 8.0.x - - - name: Setup dotnet 9.0.x + - name: Setup dotnet uses: actions/setup-dotnet@v5 with: - dotnet-version: 9.0.x - - - uses: nuget/setup-nuget@v2.0.1 - - run: nuget restore NuGetUtility.sln + dotnet-version: | + 8.0.x + 9.0.x + 10.0.x - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v2 - name: build - run: msbuild -t:rebuild -property:Configuration=TestWindows + run: msbuild -t:rebuild -restore -p:RestorePackagesConfig=true -property:Configuration=TestWindows - - name: test (${{ matrix.framework }}) + - name: test uses: josepho0918/vstest-action@main with: - testAssembly: "NuGetUtility.Test.dll" - searchFolder: "tests/NuGetUtility.Test/bin/TestWindows/${{ matrix.framework }}/" + testAssembly: "NuGet*.Test.dll" + searchFolder: "tests/*/bin/TestWindows/${{ matrix.framework }}/" runInParallel: true check_code_format: @@ -131,10 +126,12 @@ jobs: - name: Checkout repo uses: actions/checkout@v5 - - name: Setup dotnet 9.0.x + - name: Setup dotnet uses: actions/setup-dotnet@v5 with: - dotnet-version: 9.0.x + dotnet-version: | + 9.0.x + 10.0.x - name: restore run: dotnet restore @@ -146,25 +143,21 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - framework: [net8.0, net9.0] + framework: [net8.0, net9.0, net10.0] project: [App, Tests, ProjectWithReferenceContainingLicenseExpression, ProjectWithReferenceContainingFileLicense] - include: - - framework: net8.0 - dotnetVersion: "8.0.x" - - - framework: net9.0 - dotnetVersion: "9.0.x" - steps: - uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Setup dotnet ${{ matrix.dotnetVersion }} + - name: Setup dotnet uses: actions/setup-dotnet@v5 with: - dotnet-version: ${{ matrix.dotnetVersion }} + dotnet-version: | + 8.0.x + 9.0.x + 10.0.x - name: restore run: dotnet restore NuGetUtility.sln -p:TargetFramework=${{ matrix.framework }} @@ -195,17 +188,18 @@ jobs: with: fetch-depth: 0 - - name: Setup dotnet 9.0.x + - name: Setup dotnet uses: actions/setup-dotnet@v5 with: - dotnet-version: 9.0.x - - - uses: nuget/setup-nuget@v2 - - run: nuget restore NuGetUtility.sln + dotnet-version: | + 9.0.x + 10.0.x - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v2 + - run: msbuild -t:restore -p:RestorePackagesConfig=true NuGetUtility.sln + - name: fully qualify release path id: release_path shell: pwsh @@ -234,24 +228,20 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - framework: [net8.0, net9.0] - - include: - - framework: net8.0 - dotnetVersion: "8.0.x" - - - framework: net9.0 - dotnetVersion: "9.0.x" + framework: [net8.0, net9.0, net10.0] steps: - uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Setup dotnet ${{ matrix.dotnetVersion }} + - name: Setup dotnet uses: actions/setup-dotnet@v5 with: - dotnet-version: ${{ matrix.dotnetVersion }} + dotnet-version: | + 8.0.x + 9.0.x + 10.0.x - name: restore run: dotnet restore NuGetUtility.sln -p:TargetFramework=${{ matrix.framework }} @@ -281,17 +271,18 @@ jobs: with: fetch-depth: 0 - - name: Setup dotnet 9.0.x + - name: Setup dotnet uses: actions/setup-dotnet@v5 with: - dotnet-version: 9.0.x - - - uses: nuget/setup-nuget@v2 - - run: nuget restore NuGetUtility.sln + dotnet-version: | + 9.0.x + 10.0.x - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v2 + - run: msbuild -t:restore -p:RestorePackagesConfig=true NuGetUtility.sln + - name: fully qualify release path id: release_path shell: pwsh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 452e4845..9a832c3f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,43 +10,33 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v5 - - name: Setup dotnet 8.0.x - uses: actions/setup-dotnet@v5 - with: - dotnet-version: "8.0.x" - - name: Setup dotnet 9.0.x + + - name: Setup dotnet uses: actions/setup-dotnet@v5 with: - dotnet-version: "9.0.x" + dotnet-version: | + 8.0.x + 9.0.x + 10.0.x - uses: nowsprinting/check-version-format-action@v3 id: version with: prefix: 'v' - - uses: nuget/setup-nuget@v2.0.1 - - run: nuget restore NuGetUtility.sln - - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v2 - uses: browser-actions/setup-chrome@v2.1.0 - name: build - run: msbuild -t:rebuild -property:Configuration=Release - - - name: test - uses: josepho0918/vstest-action@main - with: - testAssembly: "NuGetUtility.Test.dll" - searchFolder: "tests/NuGetUtility.Test/bin/Release/net8.0/" - runInParallel: true + run: msbuild -t:rebuild -restore -p:RestorePackagesConfig=true -property:Configuration=Release - name: test uses: josepho0918/vstest-action@main with: - testAssembly: "NuGetUtility.Test.UrlToLicenseMapping.dll" - searchFolder: "tests/NuGetUtility.Test.UrlToLicenseMapping/bin/Release/net9.0/" + testAssembly: "*.Test.*dll" + searchFolder: "tests/*/bin/Release/net9.0/" runInParallel: true - name: fully qualify artifacts path @@ -60,7 +50,9 @@ jobs: - name: Publish the application binaries (.net8) run: dotnet publish ./src/NuGetLicenseCore/NuGetLicenseCore.csproj -c Release --no-restore -o ${{ steps.artifacts_path.outputs.path }}/net8 -f net8.0 -p:Version=${{ steps.version.outputs.full_without_prefix }} - name: Publish the application binaries (.net9) - run: dotnet publish ./src/NuGetLicenseCore/NuGetLicenseCore.csproj -c Release --no-restore -o ${{ steps.artifacts_path.outputs.path }}/net8 -f net9.0 -p:Version=${{ steps.version.outputs.full_without_prefix }} + run: dotnet publish ./src/NuGetLicenseCore/NuGetLicenseCore.csproj -c Release --no-restore -o ${{ steps.artifacts_path.outputs.path }}/net9 -f net9.0 -p:Version=${{ steps.version.outputs.full_without_prefix }} + - name: Publish the application binaries (.net10) + run: dotnet publish ./src/NuGetLicenseCore/NuGetLicenseCore.csproj -c Release --no-restore -o ${{ steps.artifacts_path.outputs.path }}/net10 -f net10.0 -p:Version=${{ steps.version.outputs.full_without_prefix }} - name: Publish the application binaries (.net472) run: msbuild ./src/NuGetLicenseFramework/NuGetLicenseFramework.csproj /t:Publish /p:configuration=Release /p:PublishDir=${{ steps.artifacts_path.outputs.path }}/net472 /p:Version=${{ steps.version.outputs.full_without_prefix }} - name: Create nuget package diff --git a/NuGetUtility.sln b/NuGetUtility.sln index 39be5d82..0a579859 100644 --- a/NuGetUtility.sln +++ b/NuGetUtility.sln @@ -27,6 +27,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig .globalconfig = .globalconfig + global.json = global.json README.md = README.md EndProjectSection EndProject @@ -225,8 +226,8 @@ Global {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.Release|x64.Build.0 = Release|Any CPU {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.Release|x86.ActiveCfg = Release|Any CPU {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.Release|x86.Build.0 = Release|Any CPU - {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.TestWindows|Any CPU.ActiveCfg = Debug|Any CPU - {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.TestWindows|Any CPU.Build.0 = Debug|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.TestWindows|Any CPU.ActiveCfg = TestWindows|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.TestWindows|Any CPU.Build.0 = TestWindows|Any CPU {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.TestWindows|x64.ActiveCfg = Debug|Any CPU {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.TestWindows|x64.Build.0 = Debug|Any CPU {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.TestWindows|x86.ActiveCfg = Debug|Any CPU @@ -243,8 +244,8 @@ Global {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.Release|x64.Build.0 = Release|Any CPU {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.Release|x86.ActiveCfg = Release|Any CPU {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.Release|x86.Build.0 = Release|Any CPU - {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.TestWindows|Any CPU.ActiveCfg = Debug|Any CPU - {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.TestWindows|Any CPU.Build.0 = Debug|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.TestWindows|Any CPU.ActiveCfg = TestWindows|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.TestWindows|Any CPU.Build.0 = TestWindows|Any CPU {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.TestWindows|x64.ActiveCfg = Debug|Any CPU {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.TestWindows|x64.Build.0 = Debug|Any CPU {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.TestWindows|x86.ActiveCfg = Debug|Any CPU @@ -277,8 +278,8 @@ Global {9B107A91-87F9-420C-ADF8-732C77DAFB93}.Release|x64.Build.0 = Release|x64 {9B107A91-87F9-420C-ADF8-732C77DAFB93}.Release|x86.ActiveCfg = Release|Win32 {9B107A91-87F9-420C-ADF8-732C77DAFB93}.Release|x86.Build.0 = Release|Win32 - {9B107A91-87F9-420C-ADF8-732C77DAFB93}.TestWindows|Any CPU.ActiveCfg = Debug|x64 - {9B107A91-87F9-420C-ADF8-732C77DAFB93}.TestWindows|Any CPU.Build.0 = Debug|x64 + {9B107A91-87F9-420C-ADF8-732C77DAFB93}.TestWindows|Any CPU.ActiveCfg = Release|x64 + {9B107A91-87F9-420C-ADF8-732C77DAFB93}.TestWindows|Any CPU.Build.0 = Release|x64 {9B107A91-87F9-420C-ADF8-732C77DAFB93}.TestWindows|x64.ActiveCfg = Debug|x64 {9B107A91-87F9-420C-ADF8-732C77DAFB93}.TestWindows|x64.Build.0 = Debug|x64 {9B107A91-87F9-420C-ADF8-732C77DAFB93}.TestWindows|x86.ActiveCfg = Debug|Win32 @@ -313,8 +314,8 @@ Global {A19BF89A-8B1F-4612-A923-08F52B53DC84}.Release|x64.Build.0 = Release|Any CPU {A19BF89A-8B1F-4612-A923-08F52B53DC84}.Release|x86.ActiveCfg = Release|Any CPU {A19BF89A-8B1F-4612-A923-08F52B53DC84}.Release|x86.Build.0 = Release|Any CPU - {A19BF89A-8B1F-4612-A923-08F52B53DC84}.TestWindows|Any CPU.ActiveCfg = Debug|Any CPU - {A19BF89A-8B1F-4612-A923-08F52B53DC84}.TestWindows|Any CPU.Build.0 = Debug|Any CPU + {A19BF89A-8B1F-4612-A923-08F52B53DC84}.TestWindows|Any CPU.ActiveCfg = Release|Any CPU + {A19BF89A-8B1F-4612-A923-08F52B53DC84}.TestWindows|Any CPU.Build.0 = Release|Any CPU {A19BF89A-8B1F-4612-A923-08F52B53DC84}.TestWindows|x64.ActiveCfg = Debug|Any CPU {A19BF89A-8B1F-4612-A923-08F52B53DC84}.TestWindows|x64.Build.0 = Debug|Any CPU {A19BF89A-8B1F-4612-A923-08F52B53DC84}.TestWindows|x86.ActiveCfg = Debug|Any CPU @@ -349,8 +350,8 @@ Global {AC47BC03-4D94-4E35-880A-83B7F00CCD39}.Release|x64.Build.0 = Release|Any CPU {AC47BC03-4D94-4E35-880A-83B7F00CCD39}.Release|x86.ActiveCfg = Release|Any CPU {AC47BC03-4D94-4E35-880A-83B7F00CCD39}.Release|x86.Build.0 = Release|Any CPU - {AC47BC03-4D94-4E35-880A-83B7F00CCD39}.TestWindows|Any CPU.ActiveCfg = Debug|Any CPU - {AC47BC03-4D94-4E35-880A-83B7F00CCD39}.TestWindows|Any CPU.Build.0 = Debug|Any CPU + {AC47BC03-4D94-4E35-880A-83B7F00CCD39}.TestWindows|Any CPU.ActiveCfg = TestWindows|Any CPU + {AC47BC03-4D94-4E35-880A-83B7F00CCD39}.TestWindows|Any CPU.Build.0 = TestWindows|Any CPU {AC47BC03-4D94-4E35-880A-83B7F00CCD39}.TestWindows|x64.ActiveCfg = Debug|Any CPU {AC47BC03-4D94-4E35-880A-83B7F00CCD39}.TestWindows|x64.Build.0 = Debug|Any CPU {AC47BC03-4D94-4E35-880A-83B7F00CCD39}.TestWindows|x86.ActiveCfg = Debug|Any CPU @@ -367,8 +368,8 @@ Global {D002257A-FEC7-4E79-AE66-4FD13392F592}.Release|x64.Build.0 = Release|Any CPU {D002257A-FEC7-4E79-AE66-4FD13392F592}.Release|x86.ActiveCfg = Release|Any CPU {D002257A-FEC7-4E79-AE66-4FD13392F592}.Release|x86.Build.0 = Release|Any CPU - {D002257A-FEC7-4E79-AE66-4FD13392F592}.TestWindows|Any CPU.ActiveCfg = Debug|Any CPU - {D002257A-FEC7-4E79-AE66-4FD13392F592}.TestWindows|Any CPU.Build.0 = Debug|Any CPU + {D002257A-FEC7-4E79-AE66-4FD13392F592}.TestWindows|Any CPU.ActiveCfg = TestWindows|Any CPU + {D002257A-FEC7-4E79-AE66-4FD13392F592}.TestWindows|Any CPU.Build.0 = TestWindows|Any CPU {D002257A-FEC7-4E79-AE66-4FD13392F592}.TestWindows|x64.ActiveCfg = Debug|Any CPU {D002257A-FEC7-4E79-AE66-4FD13392F592}.TestWindows|x64.Build.0 = Debug|Any CPU {D002257A-FEC7-4E79-AE66-4FD13392F592}.TestWindows|x86.ActiveCfg = Debug|Any CPU @@ -385,8 +386,8 @@ Global {B713053E-699F-4565-A90F-0A6A7BD84385}.Release|x64.Build.0 = Release|Any CPU {B713053E-699F-4565-A90F-0A6A7BD84385}.Release|x86.ActiveCfg = Release|Any CPU {B713053E-699F-4565-A90F-0A6A7BD84385}.Release|x86.Build.0 = Release|Any CPU - {B713053E-699F-4565-A90F-0A6A7BD84385}.TestWindows|Any CPU.ActiveCfg = Debug|Any CPU - {B713053E-699F-4565-A90F-0A6A7BD84385}.TestWindows|Any CPU.Build.0 = Debug|Any CPU + {B713053E-699F-4565-A90F-0A6A7BD84385}.TestWindows|Any CPU.ActiveCfg = TestWindows|Any CPU + {B713053E-699F-4565-A90F-0A6A7BD84385}.TestWindows|Any CPU.Build.0 = TestWindows|Any CPU {B713053E-699F-4565-A90F-0A6A7BD84385}.TestWindows|x64.ActiveCfg = Debug|Any CPU {B713053E-699F-4565-A90F-0A6A7BD84385}.TestWindows|x64.Build.0 = Debug|Any CPU {B713053E-699F-4565-A90F-0A6A7BD84385}.TestWindows|x86.ActiveCfg = Debug|Any CPU diff --git a/global.json b/global.json new file mode 100644 index 00000000..4c8dead0 --- /dev/null +++ b/global.json @@ -0,0 +1,9 @@ +{ + "test": { + "runner": "Microsoft.Testing.Platform" + }, + "sdk": { + "version": "10.0.100-rc.2.25502.107", + "rollForward": "latestMajor" + } +} diff --git a/src/NuGetLicense/NuGetLicense.csproj b/src/NuGetLicense/NuGetLicense.csproj index 6fadc374..f74aae20 100644 --- a/src/NuGetLicense/NuGetLicense.csproj +++ b/src/NuGetLicense/NuGetLicense.csproj @@ -1,7 +1,7 @@  - net472;net8.0;net9.0 + net472;net8.0;net9.0;net10.0 git 100.100.100 false @@ -19,29 +19,11 @@ - - - - - - - - - - - - - - - - - - all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/NuGetLicenseCore/NuGetLicenseCore.csproj b/src/NuGetLicenseCore/NuGetLicenseCore.csproj index cc9328b8..509846bc 100644 --- a/src/NuGetLicenseCore/NuGetLicenseCore.csproj +++ b/src/NuGetLicenseCore/NuGetLicenseCore.csproj @@ -2,7 +2,7 @@ Exe - net8.0;net9.0 + net8.0;net9.0;net10.0 true true DotnetTool diff --git a/src/NuGetUtility/NuGetUtility.csproj b/src/NuGetUtility/NuGetUtility.csproj index fc478293..f64d92fb 100644 --- a/src/NuGetUtility/NuGetUtility.csproj +++ b/src/NuGetUtility/NuGetUtility.csproj @@ -1,7 +1,7 @@  - net472;net8.0;net9.0 + net472;net8.0;net9.0;net10.0 git 100.100.100 false @@ -18,8 +18,7 @@ - - + @@ -34,7 +33,7 @@ - + diff --git a/src/NuGetUtility/Wrapper/MsBuildWrapper/MsBuildAbstraction.cs b/src/NuGetUtility/Wrapper/MsBuildWrapper/MsBuildAbstraction.cs index 0168052e..318613b4 100644 --- a/src/NuGetUtility/Wrapper/MsBuildWrapper/MsBuildAbstraction.cs +++ b/src/NuGetUtility/Wrapper/MsBuildWrapper/MsBuildAbstraction.cs @@ -10,8 +10,6 @@ public class MsBuildAbstraction : IMsBuildAbstraction { private ProjectCollection? _projects; - private ProjectCollection Projects => _projects ??= InitializeProjectCollection(); - public MsBuildAbstraction() { RegisterMsBuildLocatorIfNeeded(); @@ -26,7 +24,7 @@ public IProject GetProject(string projectPath) } #endif - Project project = Projects.LoadProject(projectPath); + Project project = GetProjectCollection().LoadProject(projectPath); return new ProjectWrapper(project); } @@ -39,6 +37,16 @@ private static void RegisterMsBuildLocatorIfNeeded() } } + private ProjectCollection GetProjectCollection() + { + if (_projects is null) + { + _projects = InitializeProjectCollection(); + } + + return _projects; + } + private static ProjectCollection InitializeProjectCollection() { ProjectCollection collection = ProjectCollection.GlobalProjectCollection; diff --git a/src/SPDXLicenseMatcher/JavaLibrary/ParseInstruction.cs b/src/SPDXLicenseMatcher/JavaLibrary/ParseInstruction.cs index 20b90228..0f394d23 100644 --- a/src/SPDXLicenseMatcher/JavaLibrary/ParseInstruction.cs +++ b/src/SPDXLicenseMatcher/JavaLibrary/ParseInstruction.cs @@ -644,15 +644,15 @@ public IReadOnlyList getNextOptionalTextTokens() */ public void skipNextInstruction() { - if (Parent == null) - { - return; - } - ParseInstruction? nextInst = Parent.findFollowingInstruction(this); + ParseInstruction? nextInst = Parent?.findFollowingInstruction(this); +#if NET10_0_OR_GREATER + nextInst?.Skip = true; +#else if (nextInst is not null) { nextInst.Skip = true; } +#endif } /** diff --git a/src/SPDXLicenseMatcher/SPDXLicenseMatcher.csproj b/src/SPDXLicenseMatcher/SPDXLicenseMatcher.csproj index cdf4f952..89ba3c89 100644 --- a/src/SPDXLicenseMatcher/SPDXLicenseMatcher.csproj +++ b/src/SPDXLicenseMatcher/SPDXLicenseMatcher.csproj @@ -1,7 +1,7 @@  - net472;net8.0;net9.0 + net472;net8.0;net9.0;net10.0 enable Debug;Release;TestWindows diff --git a/tests/NuGetLicense.Test/NuGetLicense.Test.csproj b/tests/NuGetLicense.Test/NuGetLicense.Test.csproj index dbbb7dd3..332e88f1 100644 --- a/tests/NuGetLicense.Test/NuGetLicense.Test.csproj +++ b/tests/NuGetLicense.Test/NuGetLicense.Test.csproj @@ -1,6 +1,6 @@  - net472;net8.0;net9.0 + net472;net8.0;net9.0;net10.0 enable enable @@ -10,6 +10,8 @@ AnyCPU True + + true diff --git a/tests/NuGetUtility.Test.Extensions/NuGetUtility.Test.Extensions.csproj b/tests/NuGetUtility.Test.Extensions/NuGetUtility.Test.Extensions.csproj index d9d3740a..8b1d630c 100644 --- a/tests/NuGetUtility.Test.Extensions/NuGetUtility.Test.Extensions.csproj +++ b/tests/NuGetUtility.Test.Extensions/NuGetUtility.Test.Extensions.csproj @@ -1,7 +1,7 @@  - net472;net8.0;net9.0 + net472;net8.0;net9.0;net10.0 enable enable diff --git a/tests/NuGetUtility.Test/NuGetUtility.Test.csproj b/tests/NuGetUtility.Test/NuGetUtility.Test.csproj index be3660fc..624176cf 100644 --- a/tests/NuGetUtility.Test/NuGetUtility.Test.csproj +++ b/tests/NuGetUtility.Test/NuGetUtility.Test.csproj @@ -1,7 +1,6 @@  - - net472;net8.0;net9.0 + net472;net8.0;net9.0;net10.0 enable enable @@ -11,6 +10,8 @@ AnyCPU True + + true