From ebb9c69dc8c31e5ca3fcf9e6bc954654b10622e9 Mon Sep 17 00:00:00 2001 From: Simon Ensslen Date: Fri, 27 Dec 2024 16:24:59 +0100 Subject: [PATCH 1/4] add slnx support --- .../ReferencedPackagesReader/ProjectsCollector.cs | 2 +- .../ProjectsCollectorTest.cs | 13 +++++++++++++ tests/targets/slnx/slnx.slnx | 8 ++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tests/targets/slnx/slnx.slnx diff --git a/src/NuGetUtility/ReferencedPackagesReader/ProjectsCollector.cs b/src/NuGetUtility/ReferencedPackagesReader/ProjectsCollector.cs index 96ac737c..70c3cae6 100644 --- a/src/NuGetUtility/ReferencedPackagesReader/ProjectsCollector.cs +++ b/src/NuGetUtility/ReferencedPackagesReader/ProjectsCollector.cs @@ -15,7 +15,7 @@ public ProjectsCollector(IMsBuildAbstraction msBuild) public IEnumerable GetProjects(string inputPath) { - return Path.GetExtension(inputPath).Equals(".sln") + return Path.GetExtension(inputPath).StartsWith(".sln") ? _msBuild.GetProjectsFromSolution(Path.GetFullPath(inputPath)).Where(File.Exists).Select(Path.GetFullPath) : new[] { Path.GetFullPath(inputPath) }; } diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.cs b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.cs index 83726e1e..13be0c87 100644 --- a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.cs +++ b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.cs @@ -44,6 +44,7 @@ public void GetProjects_Should_ReturnProjectsAsListDirectly(string projectFile) [TestCase("A.sln")] [TestCase("B.sln")] [TestCase("C.sln")] + [TestCase("A.slnx")] public void GetProjects_Should_QueryMsBuildToGetProjectsForSolutionFiles(string solutionFile) { _ = _uut.GetProjects(solutionFile); @@ -54,6 +55,7 @@ public void GetProjects_Should_QueryMsBuildToGetProjectsForSolutionFiles(string [TestCase("A.sln")] [TestCase("B.sln")] [TestCase("C.sln")] + [TestCase("C.slnx")] public void GetProjects_Should_ReturnEmptyArray_If_SolutionContainsNoProjects(string solutionFile) { _msBuild.GetProjectsFromSolution(Arg.Any()).Returns(Enumerable.Empty()); @@ -67,6 +69,7 @@ public void GetProjects_Should_ReturnEmptyArray_If_SolutionContainsNoProjects(st [TestCase("A.sln")] [TestCase("B.sln")] [TestCase("C.sln")] + [TestCase("B.slnx")] public void GetProjects_Should_ReturnEmptyArray_If_SolutionContainsProjectsThatDontExist(string solutionFile) { IEnumerable projects = _fixture.CreateMany(); @@ -81,6 +84,7 @@ public void GetProjects_Should_ReturnEmptyArray_If_SolutionContainsProjectsThatD [TestCase("A.sln")] [TestCase("B.sln")] [TestCase("C.sln")] + [TestCase("C.slnx")] public void GetProjects_Should_ReturnArrayOfProjects_If_SolutionContainsProjectsThatDoExist(string solutionFile) { string[] projects = _fixture.CreateMany().ToArray(); @@ -96,6 +100,7 @@ public void GetProjects_Should_ReturnArrayOfProjects_If_SolutionContainsProjects [TestCase("A.sln")] [TestCase("B.sln")] [TestCase("C.sln")] + [TestCase("A.slnx")] public void GetProjects_Should_ReturnOnlyExistingProjectsInSolutionFile(string solutionFile) { string[] existingProjects = _fixture.CreateMany().ToArray(); @@ -120,6 +125,14 @@ public async Task GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionF await Verify(string.Join(",", result), _osPlatformSpecificVerifySettings); } + [Test, Ignore("Ignore this specific test as long as msbuild does not fully support slnx solutions everywhere")] + public async Task GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath() + { + var msbuild = new MsBuildAbstraction(); + IEnumerable result = msbuild.GetProjectsFromSolution("../../../../targets/slnx/slnx.slnx"); + await Verify(string.Join(",", result), _osPlatformSpecificVerifySettings); + } + [Test] public async Task GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileAbsolutePath() { diff --git a/tests/targets/slnx/slnx.slnx b/tests/targets/slnx/slnx.slnx new file mode 100644 index 00000000..f5b6d54f --- /dev/null +++ b/tests/targets/slnx/slnx.slnx @@ -0,0 +1,8 @@ + + + + + + + + From 1cc1fa0674cb2572400e966f1734e92096d7d6ea Mon Sep 17 00:00:00 2001 From: Simon Ensslen Date: Mon, 3 Feb 2025 08:24:36 +0100 Subject: [PATCH 2/4] add proper slnx support --- src/NuGetUtility/Extensions/TaskExtensions.cs | 13 +++++ src/NuGetUtility/NuGetUtility.csproj | 1 + src/NuGetUtility/Program.cs | 2 +- .../ProjectsCollector.cs | 4 +- .../MsBuildWrapper/IMsBuildAbstraction.cs | 2 +- .../MsBuildWrapper/MsBuildAbstraction.cs | 12 ++-- ...olutionFileAbsolutePath.Linux.verified.txt | 1 - ...lSolutionFileAbsolutePath.OSX.verified.txt | 1 - ...utionFileAbsolutePath.Windows.verified.txt | 1 - ...olutionFileRelativePath.Linux.verified.txt | 2 +- ...lSolutionFileRelativePath.OSX.verified.txt | 2 +- ...utionFileRelativePath.Windows.verified.txt | 2 +- ...olutionFileRelativePath.Linux.verified.txt | 1 + ...lSolutionFileRelativePath.OSX.verified.txt | 1 + ...utionFileRelativePath.Windows.verified.txt | 1 + .../ProjectsCollectorTest.cs | 58 ++++++++----------- 16 files changed, 56 insertions(+), 48 deletions(-) create mode 100644 src/NuGetUtility/Extensions/TaskExtensions.cs delete mode 100644 tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileAbsolutePath.Linux.verified.txt delete mode 100644 tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileAbsolutePath.OSX.verified.txt delete mode 100644 tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileAbsolutePath.Windows.verified.txt create mode 100644 tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt create mode 100644 tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt create mode 100644 tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt diff --git a/src/NuGetUtility/Extensions/TaskExtensions.cs b/src/NuGetUtility/Extensions/TaskExtensions.cs new file mode 100644 index 00000000..d1f899ea --- /dev/null +++ b/src/NuGetUtility/Extensions/TaskExtensions.cs @@ -0,0 +1,13 @@ +// Licensed to the projects contributors. +// The license conditions are provided in the LICENSE file located in the project root + +namespace NuGetUtility.Extensions +{ + public static class TaskExtensions + { + public static async Task> SelectManyAsync(this IEnumerable enumeration, Func>> func) + { + return (await Task.WhenAll(enumeration.Select(func))).SelectMany(s => s); + } + } +} diff --git a/src/NuGetUtility/NuGetUtility.csproj b/src/NuGetUtility/NuGetUtility.csproj index 3b5c937a..0c96efb7 100644 --- a/src/NuGetUtility/NuGetUtility.csproj +++ b/src/NuGetUtility/NuGetUtility.csproj @@ -27,6 +27,7 @@ + diff --git a/src/NuGetUtility/Program.cs b/src/NuGetUtility/Program.cs index 216a0eab..58572a1d 100644 --- a/src/NuGetUtility/Program.cs +++ b/src/NuGetUtility/Program.cs @@ -128,7 +128,7 @@ private async Task OnExecuteAsync(CancellationToken cancellationToken) ignoredPackages); string[] excludedProjects = GetExcludedProjects(); - IEnumerable projects = inputFiles.SelectMany(projectCollector.GetProjects).Where(p => !Array.Exists(excludedProjects, ignored => p.Like(ignored))); + IEnumerable projects = (await inputFiles.SelectManyAsync(projectCollector.GetProjectsAsync)).Where(p => !Array.Exists(excludedProjects, ignored => p.Like(ignored))); IEnumerable packagesForProject = GetPackagesPerProject(projects, projectReader, out IReadOnlyCollection? projectReaderExceptions); IAsyncEnumerable downloadedLicenseInformation = packagesForProject.SelectMany(p => GetPackageInformations(p, overridePackageInformation, cancellationToken)); diff --git a/src/NuGetUtility/ReferencedPackagesReader/ProjectsCollector.cs b/src/NuGetUtility/ReferencedPackagesReader/ProjectsCollector.cs index 70c3cae6..2f58ec7a 100644 --- a/src/NuGetUtility/ReferencedPackagesReader/ProjectsCollector.cs +++ b/src/NuGetUtility/ReferencedPackagesReader/ProjectsCollector.cs @@ -13,10 +13,10 @@ public ProjectsCollector(IMsBuildAbstraction msBuild) _msBuild = msBuild; } - public IEnumerable GetProjects(string inputPath) + public async Task> GetProjectsAsync(string inputPath) { return Path.GetExtension(inputPath).StartsWith(".sln") - ? _msBuild.GetProjectsFromSolution(Path.GetFullPath(inputPath)).Where(File.Exists).Select(Path.GetFullPath) + ? (await _msBuild.GetProjectsFromSolutionAsync(Path.GetFullPath(inputPath))).Where(File.Exists).Select(Path.GetFullPath) : new[] { Path.GetFullPath(inputPath) }; } } diff --git a/src/NuGetUtility/Wrapper/MsBuildWrapper/IMsBuildAbstraction.cs b/src/NuGetUtility/Wrapper/MsBuildWrapper/IMsBuildAbstraction.cs index cb988f7b..384c3db3 100644 --- a/src/NuGetUtility/Wrapper/MsBuildWrapper/IMsBuildAbstraction.cs +++ b/src/NuGetUtility/Wrapper/MsBuildWrapper/IMsBuildAbstraction.cs @@ -6,6 +6,6 @@ namespace NuGetUtility.Wrapper.MsBuildWrapper public interface IMsBuildAbstraction { IProject GetProject(string projectPath); - IEnumerable GetProjectsFromSolution(string inputPath); + Task> GetProjectsFromSolutionAsync(string inputPath); } } diff --git a/src/NuGetUtility/Wrapper/MsBuildWrapper/MsBuildAbstraction.cs b/src/NuGetUtility/Wrapper/MsBuildWrapper/MsBuildAbstraction.cs index 40c16fd0..6ee33379 100644 --- a/src/NuGetUtility/Wrapper/MsBuildWrapper/MsBuildAbstraction.cs +++ b/src/NuGetUtility/Wrapper/MsBuildWrapper/MsBuildAbstraction.cs @@ -1,9 +1,10 @@ // Licensed to the projects contributors. // The license conditions are provided in the LICENSE file located in the project root -using Microsoft.Build.Construction; using Microsoft.Build.Evaluation; using Microsoft.Build.Locator; +using Microsoft.VisualStudio.SolutionPersistence; +using Microsoft.VisualStudio.SolutionPersistence.Serializer; namespace NuGetUtility.Wrapper.MsBuildWrapper { @@ -32,11 +33,12 @@ public IProject GetProject(string projectPath) return new ProjectWrapper(project); } - public IEnumerable GetProjectsFromSolution(string inputPath) + public async Task> GetProjectsFromSolutionAsync(string inputPath) { - string absolutePath = Path.IsPathRooted(inputPath) ? inputPath : Path.Combine(Environment.CurrentDirectory, inputPath); - var sln = SolutionFile.Parse(absolutePath); - return sln.ProjectsInOrder.Select(p => p.AbsolutePath); + ISolutionSerializer serializer = SolutionSerializers.GetSerializerByMoniker(inputPath) ?? throw new MsBuildAbstractionException("Failed to determine serializer for solution"); + + Microsoft.VisualStudio.SolutionPersistence.Model.SolutionModel model = await serializer.OpenAsync(inputPath, CancellationToken.None); + return model.SolutionProjects.Select(p => p.FilePath); } private static void RegisterMsBuildLocatorIfNeeded() diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileAbsolutePath.Linux.verified.txt b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileAbsolutePath.Linux.verified.txt deleted file mode 100644 index b490ad87..00000000 --- a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileAbsolutePath.Linux.verified.txt +++ /dev/null @@ -1 +0,0 @@ -{SolutionDirectory}tests/targets/PackageReferenceProject/PackageReferenceProject.csproj,{SolutionDirectory}tests/targets/PackagesConfigProject/PackagesConfigProject.csproj,{SolutionDirectory}tests/targets/ProjectWithoutNugetReferences/ProjectWithoutNugetReferences.csproj,{SolutionDirectory}tests/targets/ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj,{SolutionDirectory}tests/targets/ProjectWithTransitiveReferences/ProjectWithTransitiveReferences.csproj \ No newline at end of file diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileAbsolutePath.OSX.verified.txt b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileAbsolutePath.OSX.verified.txt deleted file mode 100644 index b490ad87..00000000 --- a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileAbsolutePath.OSX.verified.txt +++ /dev/null @@ -1 +0,0 @@ -{SolutionDirectory}tests/targets/PackageReferenceProject/PackageReferenceProject.csproj,{SolutionDirectory}tests/targets/PackagesConfigProject/PackagesConfigProject.csproj,{SolutionDirectory}tests/targets/ProjectWithoutNugetReferences/ProjectWithoutNugetReferences.csproj,{SolutionDirectory}tests/targets/ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj,{SolutionDirectory}tests/targets/ProjectWithTransitiveReferences/ProjectWithTransitiveReferences.csproj \ No newline at end of file diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileAbsolutePath.Windows.verified.txt b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileAbsolutePath.Windows.verified.txt deleted file mode 100644 index 952ecf2f..00000000 --- a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileAbsolutePath.Windows.verified.txt +++ /dev/null @@ -1 +0,0 @@ -{SolutionDirectory}tests\targets\PackageReferenceProject\PackageReferenceProject.csproj,{SolutionDirectory}tests\targets\PackagesConfigProject\PackagesConfigProject.csproj,{SolutionDirectory}tests\targets\ProjectWithoutNugetReferences\ProjectWithoutNugetReferences.csproj,{SolutionDirectory}tests\targets\ProjectWithTransitiveNuget\ProjectWithTransitiveNuget.csproj,{SolutionDirectory}tests\targets\ProjectWithTransitiveReferences\ProjectWithTransitiveReferences.csproj \ No newline at end of file diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt index b490ad87..94697e2b 100644 --- a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt +++ b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt @@ -1 +1 @@ -{SolutionDirectory}tests/targets/PackageReferenceProject/PackageReferenceProject.csproj,{SolutionDirectory}tests/targets/PackagesConfigProject/PackagesConfigProject.csproj,{SolutionDirectory}tests/targets/ProjectWithoutNugetReferences/ProjectWithoutNugetReferences.csproj,{SolutionDirectory}tests/targets/ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj,{SolutionDirectory}tests/targets/ProjectWithTransitiveReferences/ProjectWithTransitiveReferences.csproj \ No newline at end of file +{CurrentDirectory}tests/targets/PackageReferenceProject/PackageReferenceProject.csproj,{CurrentDirectory}tests/targets/PackagesConfigProject/PackagesConfigProject.csproj,{CurrentDirectory}tests/targets/ProjectWithoutNugetReferences/ProjectWithoutNugetReferences.csproj,{CurrentDirectory}tests/targets/ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj,{CurrentDirectory}tests/targets/ProjectWithTransitiveReferences/ProjectWithTransitiveReferences.csproj \ No newline at end of file diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt index b490ad87..94697e2b 100644 --- a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt +++ b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt @@ -1 +1 @@ -{SolutionDirectory}tests/targets/PackageReferenceProject/PackageReferenceProject.csproj,{SolutionDirectory}tests/targets/PackagesConfigProject/PackagesConfigProject.csproj,{SolutionDirectory}tests/targets/ProjectWithoutNugetReferences/ProjectWithoutNugetReferences.csproj,{SolutionDirectory}tests/targets/ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj,{SolutionDirectory}tests/targets/ProjectWithTransitiveReferences/ProjectWithTransitiveReferences.csproj \ No newline at end of file +{CurrentDirectory}tests/targets/PackageReferenceProject/PackageReferenceProject.csproj,{CurrentDirectory}tests/targets/PackagesConfigProject/PackagesConfigProject.csproj,{CurrentDirectory}tests/targets/ProjectWithoutNugetReferences/ProjectWithoutNugetReferences.csproj,{CurrentDirectory}tests/targets/ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj,{CurrentDirectory}tests/targets/ProjectWithTransitiveReferences/ProjectWithTransitiveReferences.csproj \ No newline at end of file diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt index 952ecf2f..737c6b4a 100644 --- a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt +++ b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt @@ -1 +1 @@ -{SolutionDirectory}tests\targets\PackageReferenceProject\PackageReferenceProject.csproj,{SolutionDirectory}tests\targets\PackagesConfigProject\PackagesConfigProject.csproj,{SolutionDirectory}tests\targets\ProjectWithoutNugetReferences\ProjectWithoutNugetReferences.csproj,{SolutionDirectory}tests\targets\ProjectWithTransitiveNuget\ProjectWithTransitiveNuget.csproj,{SolutionDirectory}tests\targets\ProjectWithTransitiveReferences\ProjectWithTransitiveReferences.csproj \ No newline at end of file +{CurrentDirectory}PackageReferenceProject\PackageReferenceProject.csproj,{CurrentDirectory}PackagesConfigProject\PackagesConfigProject.csproj,{CurrentDirectory}ProjectWithoutNugetReferences\ProjectWithoutNugetReferences.csproj,{CurrentDirectory}ProjectWithTransitiveNuget\ProjectWithTransitiveNuget.csproj,{CurrentDirectory}ProjectWithTransitiveReferences\ProjectWithTransitiveReferences.csproj \ No newline at end of file diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt new file mode 100644 index 00000000..18c79431 --- /dev/null +++ b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt @@ -0,0 +1 @@ +{ProjectDirectory}bin\Debug\ProjectWithTransitiveNuget\ProjectWithTransitiveNuget.csproj \ No newline at end of file diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt new file mode 100644 index 00000000..66bba386 --- /dev/null +++ b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt @@ -0,0 +1 @@ +{ProjectDirectory}bin/Debug/ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj \ No newline at end of file diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt new file mode 100644 index 00000000..66bba386 --- /dev/null +++ b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt @@ -0,0 +1 @@ +{ProjectDirectory}bin/Debug/ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj \ No newline at end of file diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.cs b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.cs index 13be0c87..b023b63f 100644 --- a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.cs +++ b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.cs @@ -34,110 +34,102 @@ public void SetUp() [TestCase("B.fsproj")] [TestCase("C.vbproj")] [TestCase("D.dbproj")] - public void GetProjects_Should_ReturnProjectsAsListDirectly(string projectFile) + public async Task GetProjects_Should_ReturnProjectsAsListDirectly(string projectFile) { - IEnumerable result = _uut.GetProjects(projectFile); + IEnumerable result = await _uut.GetProjectsAsync(projectFile); Assert.That(result, Is.EqualTo(new[] { Path.GetFullPath(projectFile) })); - _msBuild.DidNotReceive().GetProjectsFromSolution(Arg.Any()); + await _msBuild.DidNotReceive().GetProjectsFromSolutionAsync(Arg.Any()); } [TestCase("A.sln")] [TestCase("B.sln")] [TestCase("C.sln")] [TestCase("A.slnx")] - public void GetProjects_Should_QueryMsBuildToGetProjectsForSolutionFiles(string solutionFile) + public async Task GetProjects_Should_QueryMsBuildToGetProjectsForSolutionFiles(string solutionFile) { - _ = _uut.GetProjects(solutionFile); + _ = await _uut.GetProjectsAsync(solutionFile); - _msBuild.Received(1).GetProjectsFromSolution(Path.GetFullPath(solutionFile)); + await _msBuild.Received(1).GetProjectsFromSolutionAsync(Path.GetFullPath(solutionFile)); } [TestCase("A.sln")] [TestCase("B.sln")] [TestCase("C.sln")] [TestCase("C.slnx")] - public void GetProjects_Should_ReturnEmptyArray_If_SolutionContainsNoProjects(string solutionFile) + public async Task GetProjects_Should_ReturnEmptyArray_If_SolutionContainsNoProjects(string solutionFile) { - _msBuild.GetProjectsFromSolution(Arg.Any()).Returns(Enumerable.Empty()); + _msBuild.GetProjectsFromSolutionAsync(Arg.Any()).Returns(Task.FromResult(Enumerable.Empty())); - IEnumerable result = _uut.GetProjects(solutionFile); + IEnumerable result = await _uut.GetProjectsAsync(solutionFile); Assert.That(result, Is.Empty); - _msBuild.Received(1).GetProjectsFromSolution(Path.GetFullPath(solutionFile)); + await _msBuild.Received(1).GetProjectsFromSolutionAsync(Path.GetFullPath(solutionFile)); } [TestCase("A.sln")] [TestCase("B.sln")] [TestCase("C.sln")] [TestCase("B.slnx")] - public void GetProjects_Should_ReturnEmptyArray_If_SolutionContainsProjectsThatDontExist(string solutionFile) + public async Task GetProjects_Should_ReturnEmptyArray_If_SolutionContainsProjectsThatDontExist(string solutionFile) { IEnumerable projects = _fixture.CreateMany(); - _msBuild.GetProjectsFromSolution(Arg.Any()).Returns(projects); + _msBuild.GetProjectsFromSolutionAsync(Arg.Any()).Returns(Task.FromResult(projects)); - IEnumerable result = _uut.GetProjects(solutionFile); + IEnumerable result = await _uut.GetProjectsAsync(solutionFile); Assert.That(result, Is.Empty); - _msBuild.Received(1).GetProjectsFromSolution(Path.GetFullPath(solutionFile)); + await _msBuild.Received(1).GetProjectsFromSolutionAsync(Path.GetFullPath(solutionFile)); } [TestCase("A.sln")] [TestCase("B.sln")] [TestCase("C.sln")] [TestCase("C.slnx")] - public void GetProjects_Should_ReturnArrayOfProjects_If_SolutionContainsProjectsThatDoExist(string solutionFile) + public async Task GetProjects_Should_ReturnArrayOfProjects_If_SolutionContainsProjectsThatDoExist(string solutionFile) { string[] projects = _fixture.CreateMany().ToArray(); CreateFiles(projects); - _msBuild.GetProjectsFromSolution(Arg.Any()).Returns(projects); + _msBuild.GetProjectsFromSolutionAsync(Arg.Any()).Returns(Task.FromResult>(projects)); - IEnumerable result = _uut.GetProjects(solutionFile); + IEnumerable result = await _uut.GetProjectsAsync(solutionFile); Assert.That(result, Is.EqualTo(projects.Select(Path.GetFullPath))); - _msBuild.Received(1).GetProjectsFromSolution(Path.GetFullPath(solutionFile)); + await _msBuild.Received(1).GetProjectsFromSolutionAsync(Path.GetFullPath(solutionFile)); } [TestCase("A.sln")] [TestCase("B.sln")] [TestCase("C.sln")] [TestCase("A.slnx")] - public void GetProjects_Should_ReturnOnlyExistingProjectsInSolutionFile(string solutionFile) + public async Task GetProjects_Should_ReturnOnlyExistingProjectsInSolutionFile(string solutionFile) { string[] existingProjects = _fixture.CreateMany().ToArray(); IEnumerable missingProjects = _fixture.CreateMany(); CreateFiles(existingProjects); - _msBuild.GetProjectsFromSolution(Arg.Any()) + _msBuild.GetProjectsFromSolutionAsync(Arg.Any()) .Returns(existingProjects.Concat(missingProjects).Shuffle(54321)); - IEnumerable result = _uut.GetProjects(solutionFile); + IEnumerable result = await _uut.GetProjectsAsync(solutionFile); Assert.That(result, Is.EquivalentTo(existingProjects.Select(Path.GetFullPath))); - _msBuild.Received(1).GetProjectsFromSolution(Path.GetFullPath(solutionFile)); + await _msBuild.Received(1).GetProjectsFromSolutionAsync(Path.GetFullPath(solutionFile)); } [Test] public async Task GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath() { var msbuild = new MsBuildAbstraction(); - IEnumerable result = msbuild.GetProjectsFromSolution("../../../../targets/Projects.sln"); - await Verify(string.Join(",", result), _osPlatformSpecificVerifySettings); - } - - [Test, Ignore("Ignore this specific test as long as msbuild does not fully support slnx solutions everywhere")] - public async Task GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath() - { - var msbuild = new MsBuildAbstraction(); - IEnumerable result = msbuild.GetProjectsFromSolution("../../../../targets/slnx/slnx.slnx"); + IEnumerable result = await msbuild.GetProjectsFromSolutionAsync("../../../../targets/Projects.sln"); await Verify(string.Join(",", result), _osPlatformSpecificVerifySettings); } [Test] - public async Task GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileAbsolutePath() + public async Task GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath() { var msbuild = new MsBuildAbstraction(); - IEnumerable result = msbuild.GetProjectsFromSolution(Path.GetFullPath("../../../../targets/Projects.sln")); + IEnumerable result = await msbuild.GetProjectsFromSolutionAsync("../../../../targets/slnx/slnx.slnx"); await Verify(string.Join(",", result), _osPlatformSpecificVerifySettings); } From 2343742d76ea5370b6479335ebf97b61a74d2a2e Mon Sep 17 00:00:00 2001 From: Simon Ensslen Date: Mon, 3 Feb 2025 09:02:31 +0100 Subject: [PATCH 3/4] Fix tests --- ...nProjectsInActualSolutionFileRelativePath.Linux.verified.txt | 2 +- ...urnProjectsInActualSolutionFileRelativePath.OSX.verified.txt | 2 +- ...rojectsInActualSolutionFileRelativePath.Windows.verified.txt | 2 +- ...nProjectsInActualSolutionFileRelativePath.Linux.verified.txt | 2 +- ...urnProjectsInActualSolutionFileRelativePath.OSX.verified.txt | 2 +- ...rojectsInActualSolutionFileRelativePath.Windows.verified.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt index 94697e2b..c37cc608 100644 --- a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt +++ b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt @@ -1 +1 @@ -{CurrentDirectory}tests/targets/PackageReferenceProject/PackageReferenceProject.csproj,{CurrentDirectory}tests/targets/PackagesConfigProject/PackagesConfigProject.csproj,{CurrentDirectory}tests/targets/ProjectWithoutNugetReferences/ProjectWithoutNugetReferences.csproj,{CurrentDirectory}tests/targets/ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj,{CurrentDirectory}tests/targets/ProjectWithTransitiveReferences/ProjectWithTransitiveReferences.csproj \ No newline at end of file +PackageReferenceProject/PackageReferenceProject.csproj,PackagesConfigProject/PackagesConfigProject.csproj,ProjectWithoutNugetReferences/ProjectWithoutNugetReferences.csproj,ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj,ProjectWithTransitiveReferences/ProjectWithTransitiveReferences.csproj \ No newline at end of file diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt index 94697e2b..c37cc608 100644 --- a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt +++ b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt @@ -1 +1 @@ -{CurrentDirectory}tests/targets/PackageReferenceProject/PackageReferenceProject.csproj,{CurrentDirectory}tests/targets/PackagesConfigProject/PackagesConfigProject.csproj,{CurrentDirectory}tests/targets/ProjectWithoutNugetReferences/ProjectWithoutNugetReferences.csproj,{CurrentDirectory}tests/targets/ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj,{CurrentDirectory}tests/targets/ProjectWithTransitiveReferences/ProjectWithTransitiveReferences.csproj \ No newline at end of file +PackageReferenceProject/PackageReferenceProject.csproj,PackagesConfigProject/PackagesConfigProject.csproj,ProjectWithoutNugetReferences/ProjectWithoutNugetReferences.csproj,ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj,ProjectWithTransitiveReferences/ProjectWithTransitiveReferences.csproj \ No newline at end of file diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt index 737c6b4a..62b3e64c 100644 --- a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt +++ b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt @@ -1 +1 @@ -{CurrentDirectory}PackageReferenceProject\PackageReferenceProject.csproj,{CurrentDirectory}PackagesConfigProject\PackagesConfigProject.csproj,{CurrentDirectory}ProjectWithoutNugetReferences\ProjectWithoutNugetReferences.csproj,{CurrentDirectory}ProjectWithTransitiveNuget\ProjectWithTransitiveNuget.csproj,{CurrentDirectory}ProjectWithTransitiveReferences\ProjectWithTransitiveReferences.csproj \ No newline at end of file +PackageReferenceProject\PackageReferenceProject.csproj,PackagesConfigProject\PackagesConfigProject.csproj,ProjectWithoutNugetReferences\ProjectWithoutNugetReferences.csproj,ProjectWithTransitiveNuget\ProjectWithTransitiveNuget.csproj,ProjectWithTransitiveReferences\ProjectWithTransitiveReferences.csproj \ No newline at end of file diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt index 18c79431..70b1277e 100644 --- a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt +++ b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Linux.verified.txt @@ -1 +1 @@ -{ProjectDirectory}bin\Debug\ProjectWithTransitiveNuget\ProjectWithTransitiveNuget.csproj \ No newline at end of file +../ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj \ No newline at end of file diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt index 66bba386..70b1277e 100644 --- a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt +++ b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.OSX.verified.txt @@ -1 +1 @@ -{ProjectDirectory}bin/Debug/ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj \ No newline at end of file +../ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj \ No newline at end of file diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt index 66bba386..1a45f704 100644 --- a/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt +++ b/tests/NuGetUtility.Test/ReferencedPackagesReader/ProjectsCollectorTest.GetProjectsFromXmlSolution_Should_ReturnProjectsInActualSolutionFileRelativePath.Windows.verified.txt @@ -1 +1 @@ -{ProjectDirectory}bin/Debug/ProjectWithTransitiveNuget/ProjectWithTransitiveNuget.csproj \ No newline at end of file +..\ProjectWithTransitiveNuget\ProjectWithTransitiveNuget.csproj \ No newline at end of file From a50bc7b9d10bb4896d6f99a4d37b7e44e0d91d17 Mon Sep 17 00:00:00 2001 From: Simon Ensslen Date: Mon, 3 Feb 2025 13:30:11 +0100 Subject: [PATCH 4/4] drop net6 support --- .github/workflows/action.yml | 30 +++---------------- .github/workflows/release.yml | 6 ---- src/NuGetLicenseCore/NuGetLicenseCore.csproj | 2 +- src/NuGetUtility/NuGetUtility.csproj | 2 +- .../NuGetUtility.Test.csproj | 2 +- ...ReferencedPackagesReaderIntegrationTest.cs | 4 +-- ...getProjectWithDifferentDependencies.csproj | 4 +-- 7 files changed, 11 insertions(+), 39 deletions(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index d511633b..4df38610 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -15,12 +15,9 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] - framework: [net6.0, net8.0, net9.0] + framework: [net8.0, net9.0] include: - - framework: net6.0 - dotnetVersion: "6.0.x" - - framework: net8.0 dotnetVersion: "8.0.x" @@ -30,11 +27,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup dotnet 6.0.x - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 6.0.x - - name: Setup dotnet 8.0.x uses: actions/setup-dotnet@v4 with: @@ -59,12 +51,9 @@ jobs: runs-on: windows-latest strategy: matrix: - framework: [net6.0, net8.0, net472, net9.0] + framework: [net8.0, net472, net9.0] include: - - framework: net6.0 - dotnetVersion: "6.0.x" - - framework: net8.0 dotnetVersion: "8.0.x" @@ -73,11 +62,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup dotnet 6.0.x - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 6.0.x - - name: Setup dotnet 8.0.x uses: actions/setup-dotnet@v4 with: @@ -127,13 +111,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - framework: [net6.0, net8.0, net9.0] + framework: [net8.0, net9.0] project: [App, Tests, ProjectWithReferenceContainingLicenseExpression] include: - - framework: net6.0 - dotnetVersion: "6.0.x" - - framework: net8.0 dotnetVersion: "8.0.x" @@ -218,12 +199,9 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - framework: [net6.0, net8.0, net9.0] + framework: [net8.0, net9.0] include: - - framework: net6.0 - dotnetVersion: "6.0.x" - - framework: net8.0 dotnetVersion: "8.0.x" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da202c66..1d26a47b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,10 +10,6 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 - - name: Setup dotnet 6.0.x - uses: actions/setup-dotnet@v4 - with: - dotnet-version: "6.0.x" - name: Setup dotnet 8.0.x uses: actions/setup-dotnet@v4 with: @@ -54,8 +50,6 @@ jobs: echo "publish to path: $path" echo "path=$path" >> $env:GITHUB_OUTPUT - - name: Publish the application binaries (.net6) - run: dotnet publish ./src/NuGetLicenseCore/NuGetLicenseCore.csproj -c Release --no-restore -o ${{ steps.artifacts_path.outputs.path }}/net6 -f net6.0 -p:Version=${{ steps.version.outputs.full_without_prefix }} - 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) diff --git a/src/NuGetLicenseCore/NuGetLicenseCore.csproj b/src/NuGetLicenseCore/NuGetLicenseCore.csproj index a751a10c..f0406514 100644 --- a/src/NuGetLicenseCore/NuGetLicenseCore.csproj +++ b/src/NuGetLicenseCore/NuGetLicenseCore.csproj @@ -2,7 +2,7 @@ Exe - net6.0;net8.0;net9.0 + net8.0;net9.0 true true DotnetTool diff --git a/src/NuGetUtility/NuGetUtility.csproj b/src/NuGetUtility/NuGetUtility.csproj index 0c96efb7..ffa0a9ce 100644 --- a/src/NuGetUtility/NuGetUtility.csproj +++ b/src/NuGetUtility/NuGetUtility.csproj @@ -1,7 +1,7 @@ - net472;net6.0;net8.0;net9.0 + net472;net8.0;net9.0 git 100.100.100 false diff --git a/tests/NuGetUtility.Test/NuGetUtility.Test.csproj b/tests/NuGetUtility.Test/NuGetUtility.Test.csproj index b3b4c94d..98560645 100644 --- a/tests/NuGetUtility.Test/NuGetUtility.Test.csproj +++ b/tests/NuGetUtility.Test/NuGetUtility.Test.csproj @@ -1,7 +1,7 @@ - net472;net6.0;net8.0;net9.0 + net472;net8.0;net9.0 enable enable diff --git a/tests/NuGetUtility.Test/ReferencedPackagesReader/ReferencedPackagesReaderIntegrationTest.cs b/tests/NuGetUtility.Test/ReferencedPackagesReader/ReferencedPackagesReaderIntegrationTest.cs index 824ae50e..f4ac4a51 100644 --- a/tests/NuGetUtility.Test/ReferencedPackagesReader/ReferencedPackagesReaderIntegrationTest.cs +++ b/tests/NuGetUtility.Test/ReferencedPackagesReader/ReferencedPackagesReaderIntegrationTest.cs @@ -151,10 +151,10 @@ public void GetInstalledPackagesShould_ThrowError_For_PackagesForNativeCppProjec #endif - [TestCase("net6.0", false, "TinyCsvParser")] + [TestCase("net9.0", false, "TinyCsvParser")] [TestCase("net8.0", false, "Microsoft.Extensions.Logging.Abstractions")] [TestCase("net8.0-browser", false, "Microsoft.Extensions.Logging.Abstractions")] - [TestCase("net6.0", true, "TinyCsvParser")] + [TestCase("net9.0", true, "TinyCsvParser")] [TestCase("net8.0", true, "Microsoft.Extensions.Logging.Abstractions", "Microsoft.Extensions.DependencyInjection.Abstractions", "System.Diagnostics.DiagnosticSource")] [TestCase("net8.0-browser", true, "Microsoft.Extensions.Logging.Abstractions", "Microsoft.Extensions.DependencyInjection.Abstractions", "System.Diagnostics.DiagnosticSource")] public void GetInstalledPackagesShould_OnlyReturn_PackagesPackagesReferencedByRequestedFramework(string framework, bool includeTransitive, params string[] packages) diff --git a/tests/targets/MultiTargetProjectWithDifferentDependencies/MultiTargetProjectWithDifferentDependencies.csproj b/tests/targets/MultiTargetProjectWithDifferentDependencies/MultiTargetProjectWithDifferentDependencies.csproj index bf31adbf..44e9775b 100644 --- a/tests/targets/MultiTargetProjectWithDifferentDependencies/MultiTargetProjectWithDifferentDependencies.csproj +++ b/tests/targets/MultiTargetProjectWithDifferentDependencies/MultiTargetProjectWithDifferentDependencies.csproj @@ -1,10 +1,10 @@ - net472;net6.0;net8.0-browser + net472;net9.0;net8.0-browser - +