Skip to content

Commit

Permalink
Merge pull request #246 from unoplatform/dev/jela/net9p3
Browse files Browse the repository at this point in the history
chore: Update to net9 preview 3
  • Loading branch information
jeromelaban authored Apr 19, 2024
2 parents 4a7dd72 + 215150c commit f2ba48c
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ jobs:
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet tool install --global --version ${{ steps.gitversion.outputs.semVer }} --add-source NuGet/ uno.check
& uno-check --ci --fix --non-interactive --verbose --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 --manifest ${{ matrix.manifest }}
& uno-check --ci --fix --verbose --non-interactive --verbose --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 --manifest ${{ matrix.manifest }}
sign:
name: Sign Package
Expand Down
5 changes: 4 additions & 1 deletion UnoCheck/Checkups/AndroidSdkCheckup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ public override Task<DiagnosticResult> Examine(SharedState history)
}

var pkgToInstall = sdkInstance?.Components?.AllNotInstalled()?
.OrderBy(p => p.Revision)
.FirstOrDefault(p => p.Path.Equals(packagePath, StringComparison.OrdinalIgnoreCase)
&& p.Revision >= (v ?? p.Revision));

Expand Down Expand Up @@ -255,7 +256,9 @@ IAndroidComponent FindInstalledPackage(IEnumerable<IAndroidComponent> installed,
{
var v = !string.IsNullOrWhiteSpace(p.Version) ? new AndroidRevision(p.Version) : null;

var installedPkg = installed.FirstOrDefault(
var installedPkg = installed
.OrderBy(p => p.Revision)
.FirstOrDefault(
i => i.Path.Equals(p.Path.Trim(), StringComparison.OrdinalIgnoreCase)
&& (i.Revision >= (v ?? i.Revision) || i.InstalledRevision >= (v ?? i.Revision)));

Expand Down
9 changes: 5 additions & 4 deletions UnoCheck/Checkups/DotNetWorkloadsCheckup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ public override async Task<DiagnosticResult> Examine(SharedState history)
if (!NuGetVersion.TryParse(workloadVersion, out var rpVersion))
rpVersion = new NuGetVersion(0, 0, 0);

#if DEBUG
foreach (var installedWorload in installedPackageWorkloads)
if (Util.Verbose)
{
ReportStatus($"Reported installed: {installedWorload.id}: {installedWorload.version}", null);
foreach (var installedWorload in installedPackageWorkloads)
{
ReportStatus($"Reported installed: {installedWorload.id}: {installedWorload.version}", null);
}
}
#endif

if (installedPackageWorkloads.FirstOrDefault(ip => ip.id.Equals(rp.WorkloadManifestId, StringComparison.OrdinalIgnoreCase) && NuGetVersion.TryParse(ip.version, out var ipVersion) && ipVersion >= rpVersion) is { id: not null } installed)
{
Expand Down
34 changes: 25 additions & 9 deletions UnoCheck/DotNet/DotNetWorkloadManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,38 @@ string WriteRollbackFile(Manifest.DotNetWorkload[] workloads)
"--print-rollback"
};

var r = await Util.WrapShellCommandWithSudo(dotnetExe, DotNetCliWorkingDir, true, args.ToArray());
var r = await Util.WrapShellCommandWithSudo(dotnetExe, DotNetCliWorkingDir, Util.Verbose, args.ToArray());

// Throw if this failed with a bad exit code
if (r.ExitCode != 0)
throw new Exception("Workload command failed: `dotnet " + string.Join(' ', args) + "`");

var output = string.Join(" ", r.StandardOutput);

var startIndex = output.IndexOf(RollbackOutputBeginMarker);
var endIndex = output.IndexOf(RollbackOutputEndMarker);
var isNet8OrBelow = NuGetVersion.Parse(SdkVersion) < DotNetCheck.Manifest.DotNetSdk.Version9Preview3;

if (startIndex >= 0 && endIndex >= 0)
if(isNet8OrBelow)
{
// net8 and earlier use markers
var start = startIndex + RollbackOutputBeginMarker.Length;
output = output.Substring(start, endIndex - start);
var startIndex = output.IndexOf(RollbackOutputBeginMarker);
var endIndex = output.IndexOf(RollbackOutputEndMarker);

if (startIndex >= 0 && endIndex >= 0)
{
// net8 and earlier use markers
var start = startIndex + RollbackOutputBeginMarker.Length;
output = output.Substring(start, endIndex - start);
}
}
else
{
// This is needed to match the output of
// https://github.com/dotnet/sdk/blob/9a965db906ca70f57c4d44df1e0da09a5b662441/src/Cli/dotnet/commands/dotnet-workload/WorkloadIntegrityChecker.cs#L43
var startIndex = output.IndexOf("{");

if (startIndex >= 0)
{
output = output.Substring(startIndex);
}
}

var workloads = JsonSerializer.Deserialize<Dictionary<string, string>>(output);
Expand Down Expand Up @@ -147,7 +163,7 @@ async Task CliInstallWithRollback(string rollbackFile, IEnumerable<string> workl
args.AddRange(workloadIds);
args.AddRange(NuGetPackageSources.Select(ps => $"{addSourceArg} \"{ps}\""));

var r = await Util.WrapShellCommandWithSudo(dotnetExe, DotNetCliWorkingDir, true, args.ToArray());
var r = await Util.WrapShellCommandWithSudo(dotnetExe, DotNetCliWorkingDir, Util.Verbose, args.ToArray());

// Throw if this failed with a bad exit code
if (r.ExitCode != 0)
Expand All @@ -171,7 +187,7 @@ async Task CliRepair()
};
args.AddRange(NuGetPackageSources.Select(ps => $"{addSourceArg} \"{ps}\""));

var r = await Util.WrapShellCommandWithSudo(dotnetExe, DotNetCliWorkingDir, true, args.ToArray());
var r = await Util.WrapShellCommandWithSudo(dotnetExe, DotNetCliWorkingDir, Util.Verbose, args.ToArray());

// Throw if this failed with a bad exit code
if (r.ExitCode != 0)
Expand Down
1 change: 1 addition & 0 deletions UnoCheck/Manifest/DotNetSdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public partial class DotNetSdk
public static readonly NuGet.Versioning.NuGetVersion Version6Preview7 = new NuGet.Versioning.NuGetVersion("6.0.100-preview.7");
public static readonly NuGet.Versioning.NuGetVersion Version6Preview6 = new NuGet.Versioning.NuGetVersion("6.0.100-preview.6");
public static readonly NuGet.Versioning.NuGetVersion Version6Preview5 = new NuGet.Versioning.NuGetVersion("6.0.100-preview.5");
public static readonly NuGet.Versioning.NuGetVersion Version9Preview3 = new NuGet.Versioning.NuGetVersion("9.0.100-preview.3");

[JsonProperty("urls")]
public Urls Urls { get; set; }
Expand Down
6 changes: 3 additions & 3 deletions UnoCheck/Manifest/Manifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ namespace DotNetCheck.Manifest
{
public partial class Manifest
{
public const string DefaultManifestUrl = "https://raw.githubusercontent.com/unoplatform/uno.check/1fce0416ce3c7feea8f252e1144ac11b53a7b673/manifests/uno.ui.manifest.json";
public const string PreviewManifestUrl = "https://raw.githubusercontent.com/unoplatform/uno.check/1fce0416ce3c7feea8f252e1144ac11b53a7b673/manifests/uno.ui-preview.manifest.json";
public const string PreviewMajorManifestUrl = "https://raw.githubusercontent.com/unoplatform/uno.check/1fce0416ce3c7feea8f252e1144ac11b53a7b673/manifests/uno.ui-preview-major.manifest.json";
public const string DefaultManifestUrl = "https://raw.githubusercontent.com/unoplatform/uno.check/d060794f96301a48732e0e011146a4b908ed2368/manifests/uno.ui.manifest.json";
public const string PreviewManifestUrl = "https://raw.githubusercontent.com/unoplatform/uno.check/d060794f96301a48732e0e011146a4b908ed2368/manifests/uno.ui-preview.manifest.json";
public const string PreviewMajorManifestUrl = "https://raw.githubusercontent.com/unoplatform/uno.check/d060794f96301a48732e0e011146a4b908ed2368/manifests/uno.ui-preview-major.manifest.json";

public static Task<Manifest> FromFileOrUrl(string fileOrUrl)
{
Expand Down
30 changes: 15 additions & 15 deletions manifests/uno.ui-preview-major.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"toolVersion": "1.14.0",
"variables": {
"OPENJDK_VERSION": "11.0.20.1",
"DOTNET_SDK_VERSION": "9.0.100-preview.2.24157.14",
"MACCATALYST_SDK_VERSION": "17.2.9244-net9-p2/9.0.100-preview.2",
"IOS_SDK_VERSION": "17.2.9244-net9-p2/9.0.100-preview.2",
"MACOS_SDK_VERSION": "14.2.9244-net9-p2/9.0.100-preview.2",
"ANDROID_SDK_VERSION": "34.99.0-preview.2.189/9.0.100-preview.2",
"MAUI_VERSION": "9.0.0-preview.2.10293/9.0.100-preview.2"
"DOTNET_SDK_VERSION": "9.0.100-preview.3.24204.13",
"MACCATALYST_SDK_VERSION": "17.2.9433-net9-p3/9.0.100-preview.3",
"IOS_SDK_VERSION": "17.2.9433-net9-p3/9.0.100-preview.3",
"MACOS_SDK_VERSION": "14.2.9433-net9-p3/9.0.100-preview.3",
"ANDROID_SDK_VERSION": "34.99.0-preview.3.231/9.0.100-preview.3",
"MAUI_VERSION": "9.0.0-preview.3.10457/9.0.100-preview.3"
},
"variableMappers": [
],
Expand All @@ -26,13 +26,13 @@
"exactVersionName": "15A240d"
},
"vswin": {
"minimumVersion": "17.10.0-pre.3"
"minimumVersion": "17.10.0-pre.4"
},
"android": {
"packages": [
{
"path": "emulator",
"version": "30.8.4"
"version": "34.1.19"
},
{
"path": "build-tools;34.0.0",
Expand All @@ -58,7 +58,7 @@
},
{
"path": "platform-tools",
"version": "31.0.3"
"version": "34.0.5"
},
{
"path": "cmdline-tools;5.0",
Expand Down Expand Up @@ -100,35 +100,35 @@
{
"workloadId": "android",
"workloadManifestId": "microsoft.net.sdk.android",
"packageId": "Microsoft.NET.Sdk.Android.Manifest-9.0.100-preview.2",
"packageId": "Microsoft.NET.Sdk.Android.Manifest-9.0.100-preview.3",
"version": "$(ANDROID_SDK_VERSION)",
"supportedPlatforms": [ "Windows", "OSX" ]
"supportedPlatforms": [ "Windows", "OSX", "Linux/x64" ]
},
{
"workloadId": "ios",
"workloadManifestId": "microsoft.net.sdk.ios",
"packageId": "Microsoft.NET.Sdk.iOS.Manifest-9.0.100-preview.2",
"packageId": "Microsoft.NET.Sdk.iOS.Manifest-9.0.100-preview.3",
"version": "$(IOS_SDK_VERSION)",
"supportedPlatforms": [ "Windows", "OSX" ]
},
{
"workloadId": "maccatalyst",
"workloadManifestId": "microsoft.net.sdk.maccatalyst",
"packageId": "Microsoft.NET.Sdk.MacCatalyst.Manifest-9.0.100-preview.2",
"packageId": "Microsoft.NET.Sdk.MacCatalyst.Manifest-9.0.100-preview.3",
"version": "$(MACCATALYST_SDK_VERSION)",
"supportedPlatforms": [ "Windows", "OSX" ]
},
{
"workloadId": "macos",
"workloadManifestId": "microsoft.net.sdk.macos",
"packageId": "Microsoft.NET.Sdk.macOS.Manifest-9.0.100-preview.2",
"packageId": "Microsoft.NET.Sdk.macOS.Manifest-9.0.100-preview.3",
"version": "$(MACOS_SDK_VERSION)",
"supportedPlatforms": [ "Windows", "OSX" ]
},
{
"workloadId": "maui",
"workloadManifestId": "microsoft.net.sdk.maui",
"packageId": "Microsoft.NET.Sdk.Maui.Manifest-9.0.100-preview.2",
"packageId": "Microsoft.NET.Sdk.Maui.Manifest-9.0.100-preview.3",
"version": "$(MAUI_VERSION)",
"supportedPlatforms": [ "Windows", "OSX" ]
}
Expand Down
6 changes: 3 additions & 3 deletions manifests/uno.ui-preview.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"packages": [
{
"path": "emulator",
"version": "30.8.4"
"version": "34.1.19"
},
{
"path": "build-tools;34.0.0",
Expand All @@ -58,7 +58,7 @@
},
{
"path": "platform-tools",
"version": "31.0.3"
"version": "34.0.5"
},
{
"path": "cmdline-tools;5.0",
Expand Down Expand Up @@ -102,7 +102,7 @@
"workloadManifestId": "microsoft.net.sdk.android",
"packageId": "Microsoft.NET.Sdk.Android.Manifest-8.0.100",
"version": "$(ANDROID_SDK_VERSION)",
"supportedPlatforms": [ "Windows", "OSX" ]
"supportedPlatforms": [ "Windows", "OSX", "Linux/x64" ]
},
{
"workloadId": "ios",
Expand Down
4 changes: 2 additions & 2 deletions manifests/uno.ui.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"packages": [
{
"path": "emulator",
"version": "30.8.4"
"version": "34.1.19"
},
{
"path": "build-tools;34.0.0",
Expand All @@ -60,7 +60,7 @@
},
{
"path": "platform-tools",
"version": "31.0.3"
"version": "34.0.5"
},
{
"path": "cmdline-tools;5.0",
Expand Down

0 comments on commit f2ba48c

Please sign in to comment.