Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump dotnet-sdk from 9.0.101 to 9.0.102 in /nuget/helpers/lib/NuGetUpdater #11344

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nuget/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN ARCH=$([ $TARGETARCH = "arm64" ] && echo "arm64" || echo "x64") \

# Install .NET SDK
ARG DOTNET_LTS_SDK_VERSION=8.0.404
ARG DOTNET_STS_SDK_VERSION=9.0.101
ARG DOTNET_STS_SDK_VERSION=9.0.102
ARG DOTNET_SDK_INSTALL_URL=https://dot.net/v1/dotnet-install.sh
ENV DOTNET_INSTALL_DIR=/usr/local/dotnet/current
ENV DOTNET_INSTALL_SCRIPT_PATH=/tmp/dotnet-install.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public async Task TestProjectFiles(string projectPath, bool useDirectDiscovery)
{
// this package ships with the SDK and is automatically added for F# projects but should be manually added here to make the test consistent
// only direct package discovery finds this, though
expectedDependencies.Add(new Dependency("FSharp.Core", "9.0.100", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true));
expectedDependencies.Add(new Dependency("FSharp.Core", MockNuGetPackage.FSharpCorePackageVersion, DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true));
}

var experimentsManager = new ExperimentsManager() { UseDirectDiscovery = useDirectDiscovery };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,18 @@ private static byte[] CreateAssembly(string assemblyName, string assemblyVersion
}
});

public static string FSharpCorePackageVersion
{
get
{
var fsharpPropsPath = Path.Combine(Path.GetDirectoryName(BundledVersionsPropsPath.Value)!, "FSharp", "Microsoft.FSharp.Core.NetSdk.props");
var fsharpPropsDocument = XDocument.Load(fsharpPropsPath);
var fsharpCoreVersionElement = fsharpPropsDocument.XPathSelectElement("//*[name()='FSCorePackageVersion']")!;
var fsharpCoreVersion = fsharpCoreVersionElement.Value;
return fsharpCoreVersion;
}
}

private static readonly Dictionary<string, MockNuGetPackage> WellKnownPackages = new();
public static MockNuGetPackage WellKnownReferencePackage(string packageName, string targetFramework, (string Path, byte[] Content)[]? files = null)
{
Expand Down Expand Up @@ -430,7 +442,7 @@ public static MockNuGetPackage WellKnownHostPackage(string packageName, string t
}

string expectedVersion = matchingAppHostPack.Attribute("AppHostPackVersion")!.Value;
return new(
WellKnownPackages[key] = new MockNuGetPackage(
$"{packageName}.Host.{expectedRid}",
expectedVersion,
Files: files
Expand All @@ -440,6 +452,33 @@ public static MockNuGetPackage WellKnownHostPackage(string packageName, string t
return WellKnownPackages[key];
}

public static MockNuGetPackage WellKnownWindowsSdkRefPackage(string windowsSdkVersion)
{
var packageName = "Microsoft.Windows.SDK.NET.Ref";
var key = $"{packageName}/{windowsSdkVersion}";
if (!WellKnownPackages.ContainsKey(key))
{
var propsDocument = XDocument.Load(BundledVersionsPropsPath.Value);
var sdkTpmElement = propsDocument.XPathSelectElement($"/Project/ItemGroup/WindowsSdkSupportedTargetPlatformVersion[@Include='{windowsSdkVersion}']")!;
var packageVersion = sdkTpmElement.Attribute("WindowsSdkPackageVersion")!.Value!;
var package = new MockNuGetPackage(packageName, packageVersion, Files: [
("data/FrameworkList.xml", Encoding.UTF8.GetBytes("""
<FileList Name="Windows SDK .NET 6.0">
<!-- contents omitted -->
</FileList>
""")),
("data/RuntimeList.xml", Encoding.UTF8.GetBytes("""
<FileList Name="Windows SDK .NET 6.0" TargetFrameworkIdentifier=".NETCoreApp" TargetFrameworkVersion="6.0" FrameworkName="Microsoft.Windows.SDK.NET.Ref">
<!-- contents omitted -->
</FileList>
""")),
]);
WellKnownPackages[key] = package;
}

return WellKnownPackages[key];
}

public static MockNuGetPackage[] CommonPackages { get; } =
[
CreateSimplePackage("NETStandard.Library", "2.0.3", "netstandard2.0"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,19 +367,7 @@ await TestUpdateForProject("Some.Package", "9.0.1", "13.0.1",
MockNuGetPackage.CreateSimplePackage("Some.Package", "9.0.1", "net8.0"),
MockNuGetPackage.CreateSimplePackage("Some.Package", "13.0.1", "net8.0"),
// necessary for the `net8.0-windows10.0.19041.0` TFM
new("Microsoft.Windows.SDK.NET.Ref", "10.0.19041.54", Files:
[
("data/FrameworkList.xml", Encoding.UTF8.GetBytes("""
<FileList Name="Windows SDK .NET 6.0">
<!-- contents omitted -->
</FileList>
""")),
("data/RuntimeList.xml", Encoding.UTF8.GetBytes("""
<FileList Name="Windows SDK .NET 6.0" TargetFrameworkIdentifier=".NETCoreApp" TargetFrameworkVersion="6.0" FrameworkName="Microsoft.Windows.SDK.NET.Ref">
<!-- contents omitted -->
</FileList>
""")),
]),
MockNuGetPackage.WellKnownWindowsSdkRefPackage("10.0.19041.0"),
],
// initial
projectContents: $"""
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": "9.0.101",
"version": "9.0.102",
"rollForward": "latestMinor"
}
}
Loading