diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 350109d..5850a52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: run: dotnet build --configuration Release --no-restore -bl:logs/build.binlog - name: Test - run: dotnet test --configuration Release --no-build --logger trx --results-directory TestResults + run: dotnet test --configuration Release --no-build --report-xunit-trx --results-directory TestResults - name: Upload test results uses: actions/upload-artifact@v4 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 123eacc..d908672 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,7 +26,7 @@ jobs: run: dotnet build --configuration Release --no-restore -bl:logs/build.binlog - name: Test - run: dotnet test --configuration Release --no-build --logger trx --results-directory TestResults + run: dotnet test --configuration Release --no-build --report-xunit-trx --results-directory TestResults - name: Upload test results uses: actions/upload-artifact@v4 diff --git a/Directory.Packages.props b/Directory.Packages.props index c947ac6..7c87955 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -2,6 +2,7 @@ true true + true @@ -9,19 +10,11 @@ - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - + + \ No newline at end of file diff --git a/ReferenceProtector.sln b/ReferenceProtector.sln deleted file mode 100644 index 27bf44b..0000000 --- a/ReferenceProtector.sln +++ /dev/null @@ -1,140 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31903.59 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tasks", "Tasks", "{0EAE81AC-B663-21D5-F9F1-5E8A35DD955A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReferenceProtector.Tasks", "src\Tasks\ReferenceProtector.Tasks\ReferenceProtector.Tasks.csproj", "{4FFA772B-D095-4E1C-B1F3-AD880E38633E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReferenceProtector.Tasks.UnitTests", "src\Tasks\ReferenceProtector.Tasks.UnitTests\ReferenceProtector.Tasks.UnitTests.csproj", "{3B2C403D-24B7-4A86-91CD-65E03626D021}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReferenceProtector.Tasks.IntegrationTests", "src\Tasks\ReferenceProtector.Tasks.IntegrationTests\ReferenceProtector.Tasks.IntegrationTests.csproj", "{1B96431A-11D7-4D29-AECE-3CD09AC53482}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Analyzers", "Analyzers", "{FF259D05-2E14-DC0F-2A34-9764A5D9A6BC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReferenceProtector.Analyzers", "src\Analyzers\ReferenceProtector.Analyzers\ReferenceProtector.Analyzers.csproj", "{724C7298-3656-42EC-BCEA-F7E6648DA067}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReferenceProtector.Analyzers.Tests", "src\Analyzers\ReferenceProtector.Analyzers.Tests\ReferenceProtector.Analyzers.Tests.csproj", "{73EBA0EC-3EE2-4A27-B89F-024A0D28C681}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Package", "Package", "{1B4E6BDC-63FC-8FD5-F010-8F75E945DB5F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReferenceProtector.Package", "src\Package\ReferenceProtector.Package.csproj", "{D5182509-17C9-463C-8198-AA906D358319}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0AB3BF05-4346-4AA6-1389-037BE0695223}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReferenceProtector.IntegrationTests", "tests\ReferenceProtector.IntegrationTests\ReferenceProtector.IntegrationTests.csproj", "{D01CBF1A-E1B4-4257-B2A4-79BCB843EAA8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4FFA772B-D095-4E1C-B1F3-AD880E38633E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4FFA772B-D095-4E1C-B1F3-AD880E38633E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4FFA772B-D095-4E1C-B1F3-AD880E38633E}.Debug|x64.ActiveCfg = Debug|Any CPU - {4FFA772B-D095-4E1C-B1F3-AD880E38633E}.Debug|x64.Build.0 = Debug|Any CPU - {4FFA772B-D095-4E1C-B1F3-AD880E38633E}.Debug|x86.ActiveCfg = Debug|Any CPU - {4FFA772B-D095-4E1C-B1F3-AD880E38633E}.Debug|x86.Build.0 = Debug|Any CPU - {4FFA772B-D095-4E1C-B1F3-AD880E38633E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4FFA772B-D095-4E1C-B1F3-AD880E38633E}.Release|Any CPU.Build.0 = Release|Any CPU - {4FFA772B-D095-4E1C-B1F3-AD880E38633E}.Release|x64.ActiveCfg = Release|Any CPU - {4FFA772B-D095-4E1C-B1F3-AD880E38633E}.Release|x64.Build.0 = Release|Any CPU - {4FFA772B-D095-4E1C-B1F3-AD880E38633E}.Release|x86.ActiveCfg = Release|Any CPU - {4FFA772B-D095-4E1C-B1F3-AD880E38633E}.Release|x86.Build.0 = Release|Any CPU - {3B2C403D-24B7-4A86-91CD-65E03626D021}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3B2C403D-24B7-4A86-91CD-65E03626D021}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3B2C403D-24B7-4A86-91CD-65E03626D021}.Debug|x64.ActiveCfg = Debug|Any CPU - {3B2C403D-24B7-4A86-91CD-65E03626D021}.Debug|x64.Build.0 = Debug|Any CPU - {3B2C403D-24B7-4A86-91CD-65E03626D021}.Debug|x86.ActiveCfg = Debug|Any CPU - {3B2C403D-24B7-4A86-91CD-65E03626D021}.Debug|x86.Build.0 = Debug|Any CPU - {3B2C403D-24B7-4A86-91CD-65E03626D021}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3B2C403D-24B7-4A86-91CD-65E03626D021}.Release|Any CPU.Build.0 = Release|Any CPU - {3B2C403D-24B7-4A86-91CD-65E03626D021}.Release|x64.ActiveCfg = Release|Any CPU - {3B2C403D-24B7-4A86-91CD-65E03626D021}.Release|x64.Build.0 = Release|Any CPU - {3B2C403D-24B7-4A86-91CD-65E03626D021}.Release|x86.ActiveCfg = Release|Any CPU - {3B2C403D-24B7-4A86-91CD-65E03626D021}.Release|x86.Build.0 = Release|Any CPU - {1B96431A-11D7-4D29-AECE-3CD09AC53482}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1B96431A-11D7-4D29-AECE-3CD09AC53482}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1B96431A-11D7-4D29-AECE-3CD09AC53482}.Debug|x64.ActiveCfg = Debug|Any CPU - {1B96431A-11D7-4D29-AECE-3CD09AC53482}.Debug|x64.Build.0 = Debug|Any CPU - {1B96431A-11D7-4D29-AECE-3CD09AC53482}.Debug|x86.ActiveCfg = Debug|Any CPU - {1B96431A-11D7-4D29-AECE-3CD09AC53482}.Debug|x86.Build.0 = Debug|Any CPU - {1B96431A-11D7-4D29-AECE-3CD09AC53482}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1B96431A-11D7-4D29-AECE-3CD09AC53482}.Release|Any CPU.Build.0 = Release|Any CPU - {1B96431A-11D7-4D29-AECE-3CD09AC53482}.Release|x64.ActiveCfg = Release|Any CPU - {1B96431A-11D7-4D29-AECE-3CD09AC53482}.Release|x64.Build.0 = Release|Any CPU - {1B96431A-11D7-4D29-AECE-3CD09AC53482}.Release|x86.ActiveCfg = Release|Any CPU - {1B96431A-11D7-4D29-AECE-3CD09AC53482}.Release|x86.Build.0 = Release|Any CPU - {724C7298-3656-42EC-BCEA-F7E6648DA067}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {724C7298-3656-42EC-BCEA-F7E6648DA067}.Debug|Any CPU.Build.0 = Debug|Any CPU - {724C7298-3656-42EC-BCEA-F7E6648DA067}.Debug|x64.ActiveCfg = Debug|Any CPU - {724C7298-3656-42EC-BCEA-F7E6648DA067}.Debug|x64.Build.0 = Debug|Any CPU - {724C7298-3656-42EC-BCEA-F7E6648DA067}.Debug|x86.ActiveCfg = Debug|Any CPU - {724C7298-3656-42EC-BCEA-F7E6648DA067}.Debug|x86.Build.0 = Debug|Any CPU - {724C7298-3656-42EC-BCEA-F7E6648DA067}.Release|Any CPU.ActiveCfg = Release|Any CPU - {724C7298-3656-42EC-BCEA-F7E6648DA067}.Release|Any CPU.Build.0 = Release|Any CPU - {724C7298-3656-42EC-BCEA-F7E6648DA067}.Release|x64.ActiveCfg = Release|Any CPU - {724C7298-3656-42EC-BCEA-F7E6648DA067}.Release|x64.Build.0 = Release|Any CPU - {724C7298-3656-42EC-BCEA-F7E6648DA067}.Release|x86.ActiveCfg = Release|Any CPU - {724C7298-3656-42EC-BCEA-F7E6648DA067}.Release|x86.Build.0 = Release|Any CPU - {73EBA0EC-3EE2-4A27-B89F-024A0D28C681}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {73EBA0EC-3EE2-4A27-B89F-024A0D28C681}.Debug|Any CPU.Build.0 = Debug|Any CPU - {73EBA0EC-3EE2-4A27-B89F-024A0D28C681}.Debug|x64.ActiveCfg = Debug|Any CPU - {73EBA0EC-3EE2-4A27-B89F-024A0D28C681}.Debug|x64.Build.0 = Debug|Any CPU - {73EBA0EC-3EE2-4A27-B89F-024A0D28C681}.Debug|x86.ActiveCfg = Debug|Any CPU - {73EBA0EC-3EE2-4A27-B89F-024A0D28C681}.Debug|x86.Build.0 = Debug|Any CPU - {73EBA0EC-3EE2-4A27-B89F-024A0D28C681}.Release|Any CPU.ActiveCfg = Release|Any CPU - {73EBA0EC-3EE2-4A27-B89F-024A0D28C681}.Release|Any CPU.Build.0 = Release|Any CPU - {73EBA0EC-3EE2-4A27-B89F-024A0D28C681}.Release|x64.ActiveCfg = Release|Any CPU - {73EBA0EC-3EE2-4A27-B89F-024A0D28C681}.Release|x64.Build.0 = Release|Any CPU - {73EBA0EC-3EE2-4A27-B89F-024A0D28C681}.Release|x86.ActiveCfg = Release|Any CPU - {73EBA0EC-3EE2-4A27-B89F-024A0D28C681}.Release|x86.Build.0 = Release|Any CPU - {D5182509-17C9-463C-8198-AA906D358319}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D5182509-17C9-463C-8198-AA906D358319}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D5182509-17C9-463C-8198-AA906D358319}.Debug|x64.ActiveCfg = Debug|Any CPU - {D5182509-17C9-463C-8198-AA906D358319}.Debug|x64.Build.0 = Debug|Any CPU - {D5182509-17C9-463C-8198-AA906D358319}.Debug|x86.ActiveCfg = Debug|Any CPU - {D5182509-17C9-463C-8198-AA906D358319}.Debug|x86.Build.0 = Debug|Any CPU - {D5182509-17C9-463C-8198-AA906D358319}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D5182509-17C9-463C-8198-AA906D358319}.Release|Any CPU.Build.0 = Release|Any CPU - {D5182509-17C9-463C-8198-AA906D358319}.Release|x64.ActiveCfg = Release|Any CPU - {D5182509-17C9-463C-8198-AA906D358319}.Release|x64.Build.0 = Release|Any CPU - {D5182509-17C9-463C-8198-AA906D358319}.Release|x86.ActiveCfg = Release|Any CPU - {D5182509-17C9-463C-8198-AA906D358319}.Release|x86.Build.0 = Release|Any CPU - {D01CBF1A-E1B4-4257-B2A4-79BCB843EAA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D01CBF1A-E1B4-4257-B2A4-79BCB843EAA8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D01CBF1A-E1B4-4257-B2A4-79BCB843EAA8}.Debug|x64.ActiveCfg = Debug|Any CPU - {D01CBF1A-E1B4-4257-B2A4-79BCB843EAA8}.Debug|x64.Build.0 = Debug|Any CPU - {D01CBF1A-E1B4-4257-B2A4-79BCB843EAA8}.Debug|x86.ActiveCfg = Debug|Any CPU - {D01CBF1A-E1B4-4257-B2A4-79BCB843EAA8}.Debug|x86.Build.0 = Debug|Any CPU - {D01CBF1A-E1B4-4257-B2A4-79BCB843EAA8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D01CBF1A-E1B4-4257-B2A4-79BCB843EAA8}.Release|Any CPU.Build.0 = Release|Any CPU - {D01CBF1A-E1B4-4257-B2A4-79BCB843EAA8}.Release|x64.ActiveCfg = Release|Any CPU - {D01CBF1A-E1B4-4257-B2A4-79BCB843EAA8}.Release|x64.Build.0 = Release|Any CPU - {D01CBF1A-E1B4-4257-B2A4-79BCB843EAA8}.Release|x86.ActiveCfg = Release|Any CPU - {D01CBF1A-E1B4-4257-B2A4-79BCB843EAA8}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {0EAE81AC-B663-21D5-F9F1-5E8A35DD955A} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} - {4FFA772B-D095-4E1C-B1F3-AD880E38633E} = {0EAE81AC-B663-21D5-F9F1-5E8A35DD955A} - {3B2C403D-24B7-4A86-91CD-65E03626D021} = {0EAE81AC-B663-21D5-F9F1-5E8A35DD955A} - {1B96431A-11D7-4D29-AECE-3CD09AC53482} = {0EAE81AC-B663-21D5-F9F1-5E8A35DD955A} - {FF259D05-2E14-DC0F-2A34-9764A5D9A6BC} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} - {724C7298-3656-42EC-BCEA-F7E6648DA067} = {FF259D05-2E14-DC0F-2A34-9764A5D9A6BC} - {73EBA0EC-3EE2-4A27-B89F-024A0D28C681} = {FF259D05-2E14-DC0F-2A34-9764A5D9A6BC} - {1B4E6BDC-63FC-8FD5-F010-8F75E945DB5F} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} - {D5182509-17C9-463C-8198-AA906D358319} = {1B4E6BDC-63FC-8FD5-F010-8F75E945DB5F} - {D01CBF1A-E1B4-4257-B2A4-79BCB843EAA8} = {0AB3BF05-4346-4AA6-1389-037BE0695223} - EndGlobalSection -EndGlobal diff --git a/ReferenceProtector.slnx b/ReferenceProtector.slnx new file mode 100644 index 0000000..66d1c99 --- /dev/null +++ b/ReferenceProtector.slnx @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/global.json b/global.json index 08777f1..8a27456 100644 --- a/global.json +++ b/global.json @@ -1,10 +1,13 @@ { "sdk": { - "version": "9.0.303", + "version": "10.0.103", "rollForward": "latestFeature" }, "msbuild-sdks": { - "Microsoft.Build.NoTargets": "3.7.56", - "Microsoft.Build.Traversal": "3.4.0" - } + "Microsoft.Build.NoTargets": "3.7.134", + "Microsoft.Build.Traversal": "4.1.82" + }, + "test": { + "runner": "Microsoft.Testing.Platform" + } } diff --git a/samples/ClassB/ClassB.csproj b/samples/ClassB/ClassB.csproj index 8fcdcdb..2c012e7 100644 --- a/samples/ClassB/ClassB.csproj +++ b/samples/ClassB/ClassB.csproj @@ -5,6 +5,5 @@ - diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props index 995adc0..47be018 100644 --- a/samples/Directory.Build.props +++ b/samples/Directory.Build.props @@ -1,7 +1,7 @@ - net9.0 + net10.0 $(NoWarn);CS1591 enable enable diff --git a/samples/Samples.sln b/samples/Samples.sln deleted file mode 100644 index fa4eba1..0000000 --- a/samples/Samples.sln +++ /dev/null @@ -1,62 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31903.59 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassA", "ClassA\ClassA.csproj", "{C8717F5F-50D3-4009-83BA-E38210E1FC7F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassB", "ClassB\ClassB.csproj", "{1F7AD001-B9D6-4E58-9DE1-2DB425AE7C96}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassC", "ClassC\ClassC.csproj", "{7A1596DA-EFD6-47A3-87EE-2776E22ECC11}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C8717F5F-50D3-4009-83BA-E38210E1FC7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C8717F5F-50D3-4009-83BA-E38210E1FC7F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C8717F5F-50D3-4009-83BA-E38210E1FC7F}.Debug|x64.ActiveCfg = Debug|Any CPU - {C8717F5F-50D3-4009-83BA-E38210E1FC7F}.Debug|x64.Build.0 = Debug|Any CPU - {C8717F5F-50D3-4009-83BA-E38210E1FC7F}.Debug|x86.ActiveCfg = Debug|Any CPU - {C8717F5F-50D3-4009-83BA-E38210E1FC7F}.Debug|x86.Build.0 = Debug|Any CPU - {C8717F5F-50D3-4009-83BA-E38210E1FC7F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C8717F5F-50D3-4009-83BA-E38210E1FC7F}.Release|Any CPU.Build.0 = Release|Any CPU - {C8717F5F-50D3-4009-83BA-E38210E1FC7F}.Release|x64.ActiveCfg = Release|Any CPU - {C8717F5F-50D3-4009-83BA-E38210E1FC7F}.Release|x64.Build.0 = Release|Any CPU - {C8717F5F-50D3-4009-83BA-E38210E1FC7F}.Release|x86.ActiveCfg = Release|Any CPU - {C8717F5F-50D3-4009-83BA-E38210E1FC7F}.Release|x86.Build.0 = Release|Any CPU - {1F7AD001-B9D6-4E58-9DE1-2DB425AE7C96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F7AD001-B9D6-4E58-9DE1-2DB425AE7C96}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F7AD001-B9D6-4E58-9DE1-2DB425AE7C96}.Debug|x64.ActiveCfg = Debug|Any CPU - {1F7AD001-B9D6-4E58-9DE1-2DB425AE7C96}.Debug|x64.Build.0 = Debug|Any CPU - {1F7AD001-B9D6-4E58-9DE1-2DB425AE7C96}.Debug|x86.ActiveCfg = Debug|Any CPU - {1F7AD001-B9D6-4E58-9DE1-2DB425AE7C96}.Debug|x86.Build.0 = Debug|Any CPU - {1F7AD001-B9D6-4E58-9DE1-2DB425AE7C96}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F7AD001-B9D6-4E58-9DE1-2DB425AE7C96}.Release|Any CPU.Build.0 = Release|Any CPU - {1F7AD001-B9D6-4E58-9DE1-2DB425AE7C96}.Release|x64.ActiveCfg = Release|Any CPU - {1F7AD001-B9D6-4E58-9DE1-2DB425AE7C96}.Release|x64.Build.0 = Release|Any CPU - {1F7AD001-B9D6-4E58-9DE1-2DB425AE7C96}.Release|x86.ActiveCfg = Release|Any CPU - {1F7AD001-B9D6-4E58-9DE1-2DB425AE7C96}.Release|x86.Build.0 = Release|Any CPU - {7A1596DA-EFD6-47A3-87EE-2776E22ECC11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A1596DA-EFD6-47A3-87EE-2776E22ECC11}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A1596DA-EFD6-47A3-87EE-2776E22ECC11}.Debug|x64.ActiveCfg = Debug|Any CPU - {7A1596DA-EFD6-47A3-87EE-2776E22ECC11}.Debug|x64.Build.0 = Debug|Any CPU - {7A1596DA-EFD6-47A3-87EE-2776E22ECC11}.Debug|x86.ActiveCfg = Debug|Any CPU - {7A1596DA-EFD6-47A3-87EE-2776E22ECC11}.Debug|x86.Build.0 = Debug|Any CPU - {7A1596DA-EFD6-47A3-87EE-2776E22ECC11}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A1596DA-EFD6-47A3-87EE-2776E22ECC11}.Release|Any CPU.Build.0 = Release|Any CPU - {7A1596DA-EFD6-47A3-87EE-2776E22ECC11}.Release|x64.ActiveCfg = Release|Any CPU - {7A1596DA-EFD6-47A3-87EE-2776E22ECC11}.Release|x64.Build.0 = Release|Any CPU - {7A1596DA-EFD6-47A3-87EE-2776E22ECC11}.Release|x86.ActiveCfg = Release|Any CPU - {7A1596DA-EFD6-47A3-87EE-2776E22ECC11}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/samples/Samples.slnx b/samples/Samples.slnx new file mode 100644 index 0000000..af05ccc --- /dev/null +++ b/samples/Samples.slnx @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/Analyzers/ReferenceProtector.Analyzers.Tests/ReferenceProtector.Analyzers.Tests.csproj b/src/Analyzers/ReferenceProtector.Analyzers.Tests/ReferenceProtector.Analyzers.Tests.csproj index a59bb34..adf2164 100644 --- a/src/Analyzers/ReferenceProtector.Analyzers.Tests/ReferenceProtector.Analyzers.Tests.csproj +++ b/src/Analyzers/ReferenceProtector.Analyzers.Tests/ReferenceProtector.Analyzers.Tests.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 enable enable Exe @@ -9,12 +9,7 @@ - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - + diff --git a/src/Build/ReferenceProtector.targets b/src/Build/ReferenceProtector.targets index b96e3be..97497c1 100644 --- a/src/Build/ReferenceProtector.targets +++ b/src/Build/ReferenceProtector.targets @@ -9,7 +9,7 @@ - <_ReferenceProtectorDeclaredReferences>$(IntermediateOutputPath)\_ReferenceProtector_DeclaredReferences.tsv + <_ReferenceProtectorDeclaredReferences>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)\_ReferenceProtector_DeclaredReferences.tsv')) <_ReferenceProtectorReferences Include="@(Reference)" /> diff --git a/src/Tasks/ReferenceProtector.Tasks.IntegrationTests/ReferenceProtector.Tasks.IntegrationTests.csproj b/src/Tasks/ReferenceProtector.Tasks.IntegrationTests/ReferenceProtector.Tasks.IntegrationTests.csproj index e3923c0..b8ac8d1 100644 --- a/src/Tasks/ReferenceProtector.Tasks.IntegrationTests/ReferenceProtector.Tasks.IntegrationTests.csproj +++ b/src/Tasks/ReferenceProtector.Tasks.IntegrationTests/ReferenceProtector.Tasks.IntegrationTests.csproj @@ -2,20 +2,13 @@ Exe - net9.0 + net10.0 - + - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - diff --git a/src/Tasks/ReferenceProtector.Tasks.IntegrationTests/ReferenceProtector.Tasks.TestBase.cs b/src/Tasks/ReferenceProtector.Tasks.IntegrationTests/ReferenceProtector.Tasks.TestBase.cs index 85a95c4..82de26c 100644 --- a/src/Tasks/ReferenceProtector.Tasks.IntegrationTests/ReferenceProtector.Tasks.TestBase.cs +++ b/src/Tasks/ReferenceProtector.Tasks.IntegrationTests/ReferenceProtector.Tasks.TestBase.cs @@ -60,6 +60,14 @@ internal string SetupTestEnvironment() """); } + // Create an empty Directory.Packages.props to decouple from the repo's CPM settings + { + var packagesPropsPath = Path.Combine(testDirectory, "Directory.Packages.props"); + Output.WriteLine($"Creating packages props file: {packagesPropsPath}"); + + File.WriteAllText(packagesPropsPath, """"""); + } + // Create the build props file { var buildPropsPath = Path.Combine(testDirectory, "Directory.Build.props"); @@ -68,6 +76,9 @@ internal string SetupTestEnvironment() File.WriteAllText(buildPropsPath, """ + + false + """); } diff --git a/src/Tasks/ReferenceProtector.Tasks.UnitTests/ReferenceProtector.Tasks.UnitTests.csproj b/src/Tasks/ReferenceProtector.Tasks.UnitTests/ReferenceProtector.Tasks.UnitTests.csproj index 28eae07..8b0d117 100644 --- a/src/Tasks/ReferenceProtector.Tasks.UnitTests/ReferenceProtector.Tasks.UnitTests.csproj +++ b/src/Tasks/ReferenceProtector.Tasks.UnitTests/ReferenceProtector.Tasks.UnitTests.csproj @@ -2,22 +2,15 @@ Exe - net9.0 + net10.0 enable enable - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - + diff --git a/src/Tasks/ReferenceProtector.Tasks/ReferenceProtector.Tasks.csproj b/src/Tasks/ReferenceProtector.Tasks/ReferenceProtector.Tasks.csproj index 86de548..6d66700 100644 --- a/src/Tasks/ReferenceProtector.Tasks/ReferenceProtector.Tasks.csproj +++ b/src/Tasks/ReferenceProtector.Tasks/ReferenceProtector.Tasks.csproj @@ -2,7 +2,7 @@ netstandard2.0 - 13.0 + Latest enable diff --git a/tests/ReferenceProtector.IntegrationTests/ReferenceProtector.IntegrationTests.TestBase.cs b/tests/ReferenceProtector.IntegrationTests/ReferenceProtector.IntegrationTests.TestBase.cs index 9b905f0..243568a 100644 --- a/tests/ReferenceProtector.IntegrationTests/ReferenceProtector.IntegrationTests.TestBase.cs +++ b/tests/ReferenceProtector.IntegrationTests/ReferenceProtector.IntegrationTests.TestBase.cs @@ -81,7 +81,28 @@ internal string SetupTestEnvironment() """); - } + } + + // Create a nuget.config that includes both the local package source (for ReferenceProtector) + // and NuGet.org (for framework packages like Microsoft.NETCore.App.Ref). + // This avoids using -s which replaces all sources and can cause flaky NU1101 failures + // when framework targeting packs aren't in the global NuGet cache yet. + { + var nugetConfigPath = Path.Combine(testDirectory, "nuget.config"); + var localSource = Directory.GetCurrentDirectory(); + Output.WriteLine($"Creating nuget.config file: {nugetConfigPath} (local source: {localSource})"); + + File.WriteAllText(nugetConfigPath, $""" + + + + + + + + +"""); + } return testDirectory; } @@ -149,13 +170,13 @@ internal async Task> Build(string additionalArgs = "") string warningsFilePath = Path.Combine(logDirBase, "build.warnings.log"); string errorsFilePath = Path.Combine(logDirBase, "build.errors.log"); - await RunDotnetCommandAsync(TestDirectory, $"restore dirs.proj -f -s {Directory.GetParent(TestDirectory)}", TestContext.Current.CancellationToken); + await RunDotnetCommandAsync(TestDirectory, $"restore dirs.proj -f", TestContext.Current.CancellationToken); await RunDotnetCommandAsync(TestDirectory, $"dotnet list dirs.proj package", TestContext.Current.CancellationToken); string buildArgs = $"build dirs.proj " + $"-m:1 -t:Rebuild -nologo -nodeReuse:false -noAutoResponse " + - $"/p:Configuration=Debug /p:RestoreSources=\"{Directory.GetParent(TestDirectory)}\" " + + $"/p:Configuration=Debug " + $"-bl:\"{binlogFilePath}\" " + $"-flp1:logfile=\"{errorsFilePath}\";errorsonly " + $"-flp2:logfile=\"{warningsFilePath}\";warningsonly " + diff --git a/tests/ReferenceProtector.IntegrationTests/ReferenceProtector.IntegrationTests.csproj b/tests/ReferenceProtector.IntegrationTests/ReferenceProtector.IntegrationTests.csproj index 4991c0c..a52de78 100644 --- a/tests/ReferenceProtector.IntegrationTests/ReferenceProtector.IntegrationTests.csproj +++ b/tests/ReferenceProtector.IntegrationTests/ReferenceProtector.IntegrationTests.csproj @@ -1,7 +1,7 @@  - + false Build;Pack @@ -9,20 +9,13 @@ Exe - net9.0 + net10.0 - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - +