Skip to content

Commit

Permalink
Update to .NET 9
Browse files Browse the repository at this point in the history
Update NuGetUpdater to target .NET 9 so that tests can test compatibility with `net9.0`.
  • Loading branch information
martincostello committed Sep 21, 2024
1 parent c452545 commit 3e0cb4b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nuget/helpers/lib/NuGetUpdater/Directory.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
NuGetUpdater\NuGetUpdater.Core\FrameworkChecker\SupportedFrameworks.cs
2. Update tests as needed at `NuGetUpdater\NuGetUpdater.Core.Test\FrameworkChecker\CompatibilityCheckerFacts.cs`
-->
<CommonTargetFramework>net8.0</CommonTargetFramework>
<CommonTargetFramework>net9.0</CommonTargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<UseArtifactsOutput>true</UseArtifactsOutput>
<ArtifactsPath>$(MSBuildThisFileDirectory)artifacts</ArtifactsPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ await File.WriteAllTextAsync(projectPath, """
""");
var executableName = Path.Join(Path.GetDirectoryName(GetType().Assembly.Location), "NuGetUpdater.Cli.dll");
var executableArgs = string.Join(" ",
[
executableName,
"update",
"--repo-root",
Expand All @@ -366,8 +365,7 @@ await File.WriteAllTextAsync(projectPath, """
"13.0.1",
"--previous-version",
"7.0.1",
"--verbose"
]);
"--verbose");

// verify base run
var workingDirectory = tempDir.DirectoryPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ public static MockNuGetPackage WellKnownReferencePackage(string packageName, str
WellKnownReferencePackage("Microsoft.AspNetCore.App", "net6.0"),
WellKnownReferencePackage("Microsoft.AspNetCore.App", "net7.0"),
WellKnownReferencePackage("Microsoft.AspNetCore.App", "net8.0"),
WellKnownReferencePackage("Microsoft.AspNetCore.App", "net9.0"),
WellKnownReferencePackage("Microsoft.NETCore.App", "net6.0",
[
("data/FrameworkList.xml", Encoding.UTF8.GetBytes("""
Expand All @@ -412,9 +413,17 @@ public static MockNuGetPackage WellKnownReferencePackage(string packageName, str
</FileList>
"""))
]),
WellKnownReferencePackage("Microsoft.NETCore.App", "net9.0",
[
("data/FrameworkList.xml", Encoding.UTF8.GetBytes("""
<FileList TargetFrameworkIdentifier=".NETCoreApp" TargetFrameworkVersion="9.0" FrameworkName="Microsoft.NETCore.App" Name=".NET Runtime">
</FileList>
"""))
]),
WellKnownReferencePackage("Microsoft.WindowsDesktop.App", "net6.0"),
WellKnownReferencePackage("Microsoft.WindowsDesktop.App", "net7.0"),
WellKnownReferencePackage("Microsoft.WindowsDesktop.App", "net8.0"),
WellKnownReferencePackage("Microsoft.WindowsDesktop.App", "net9.0"),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class Sdk : UpdateWorkerTestBase
[InlineData("net472")]
[InlineData("net7.0")]
[InlineData("net8.0")]
[InlineData("net9.0")]
public async Task UpdateVersionAttribute_InProjectFile_ForPackageReferenceInclude(string tfm)
{
// update Some.Package from 9.0.1 to 13.0.1
Expand Down
2 changes: 1 addition & 1 deletion nuget/helpers/lib/NuGetUpdater/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.401",
"version": "9.0.100-rc.1.24452.12",
"rollForward": "latestMinor"
}
}

0 comments on commit 3e0cb4b

Please sign in to comment.