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

chore: Upgrade preview major to net9 #231

Merged
merged 2 commits into from
Feb 14, 2024
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
- manifest: 'manifests\uno.ui-preview.manifest.json'
manifest_name: Preview
- manifest: 'manifests\uno.ui-preview-major.manifest.json'
manifest_name: Preview net8
manifest_name: Preview net9
- manifest: 'manifests\uno.ui.manifest.json'
manifest_name: Stable Upgrade
previous_tool_version: 1.4.2
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
dotnet_version: 8.0.200

# - manifest: 'manifests/uno.ui-preview-major.manifest.json'
# manifest_name: Preview net8
# manifest_name: Preview net9
# previous_tool_version: ''
# previous_tool_params: ''
# os: macos-11
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
dotnet_version: 8.0.200

# - manifest: 'manifests/uno.ui-preview-major.manifest.json'
# manifest_name: Preview net8
# manifest_name: Preview net9
# previous_tool_version: ''
# previous_tool_params: ''
# os: macos-12
Expand Down Expand Up @@ -303,7 +303,7 @@ jobs:
- manifest: 'manifests/uno.ui-preview.manifest.json'
manifest_name: Preview
- manifest: 'manifests/uno.ui-preview-major.manifest.json'
manifest_name: Preview net8
manifest_name: Preview net9

- manifest: 'manifests/uno.ui.manifest.json'
manifest_name: Stable Upgrade
Expand Down
59 changes: 29 additions & 30 deletions UnoCheck/DotNet/DotNetWorkloadManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,49 +84,48 @@ string WriteRollbackFile(Manifest.DotNetWorkload[] workloads)
const string RollbackOutputBeginMarker = "==workloadRollbackDefinitionJsonOutputStart==";
const string RollbackOutputEndMarker = "==workloadRollbackDefinitionJsonOutputEnd==";

public async Task<(string id, string version, string sdkVersion)[]> GetInstalledWorkloads()
{
var dotnetExe = Path.Combine(SdkRoot, DotNetSdk.DotNetExeName);
public async Task<(string id, string version, string sdkVersion)[]> GetInstalledWorkloads()
{
var dotnetExe = Path.Combine(SdkRoot, DotNetSdk.DotNetExeName);

var args = new List<string>
{
"workload",
"update",
"--print-rollback"
};
var args = new List<string>
{
"workload",
"update",
"--print-rollback"
};

var r = await Util.WrapShellCommandWithSudo(dotnetExe, DotNetCliWorkingDir, true, args.ToArray());
var r = await Util.WrapShellCommandWithSudo(dotnetExe, DotNetCliWorkingDir, true, 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) + "`");
// 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);

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

var workloads = JsonSerializer.Deserialize<Dictionary<string, string>>(json);
var workloads = JsonSerializer.Deserialize<Dictionary<string, string>>(output);

return workloads
.Select(p => {
var versionParts = p.Value.Split("/", StringSplitOptions.None);
var workloadVersion = versionParts.First();
var workloadSdkVersion = versionParts.ElementAtOrDefault(1) is { Length: > 0 } v ? v : "";
return workloads
.Select(p =>
{
var versionParts = p.Value.Split("/", StringSplitOptions.None);
var workloadVersion = versionParts.First();
var workloadSdkVersion = versionParts.ElementAtOrDefault(1) is { Length: > 0 } v ? v : "";

return (p.Key, workloadVersion, workloadSdkVersion);
})
.ToArray();
}
else
{
throw new Exception("Workload command output cannot be parsed: `dotnet " + string.Join(' ', args) + "`");
}
}
return (p.Key, workloadVersion, workloadSdkVersion);
})
.ToArray();
}

async Task CliInstallWithRollback(string rollbackFile, IEnumerable<string> workloadIds)
{
Expand Down
22 changes: 11 additions & 11 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": "8.0.200",
"MACCATALYST_SDK_VERSION": "17.2.8022/8.0.100",
"IOS_SDK_VERSION": "17.2.8022/8.0.100",
"MACOS_SDK_VERSION": "14.2.8022/8.0.100",
"ANDROID_SDK_VERSION": "34.0.79/8.0.100",
"MAUI_VERSION": "8.0.6/8.0.100"
"DOTNET_SDK_VERSION": "9.0.100-preview.1.24101.2",
"MACCATALYST_SDK_VERSION": "17.2.9088-net9-p1/9.0.100-preview.1",
"IOS_SDK_VERSION": "17.2.9088-net9-p1/9.0.100-preview.1",
"MACOS_SDK_VERSION": "14.2.9088-net9-p1/9.0.100-preview.1",
"ANDROID_SDK_VERSION": "34.99.0-preview.1.151/9.0.100-preview.1",
"MAUI_VERSION": "9.0.0-preview.1.9973/9.0.100-preview.1"
},
"variableMappers": [
],
Expand Down Expand Up @@ -100,35 +100,35 @@
{
"workloadId": "android",
"workloadManifestId": "microsoft.net.sdk.android",
"packageId": "Microsoft.NET.Sdk.Android.Manifest-8.0.100",
"packageId": "Microsoft.NET.Sdk.Android.Manifest-9.0.100-preview.1",
"version": "$(ANDROID_SDK_VERSION)",
"supportedPlatforms": [ "Windows", "OSX" ]
},
{
"workloadId": "ios",
"workloadManifestId": "microsoft.net.sdk.ios",
"packageId": "Microsoft.NET.Sdk.iOS.Manifest-8.0.100",
"packageId": "Microsoft.NET.Sdk.iOS.Manifest-9.0.100-preview.1",
"version": "$(IOS_SDK_VERSION)",
"supportedPlatforms": [ "Windows", "OSX" ]
},
{
"workloadId": "maccatalyst",
"workloadManifestId": "microsoft.net.sdk.maccatalyst",
"packageId": "Microsoft.NET.Sdk.MacCatalyst.Manifest-8.0.100",
"packageId": "Microsoft.NET.Sdk.MacCatalyst.Manifest-9.0.100-preview.1",
"version": "$(MACCATALYST_SDK_VERSION)",
"supportedPlatforms": [ "Windows", "OSX" ]
},
{
"workloadId": "macos",
"workloadManifestId": "microsoft.net.sdk.macos",
"packageId": "Microsoft.NET.Sdk.macOS.Manifest-8.0.100",
"packageId": "Microsoft.NET.Sdk.macOS.Manifest-9.0.100-preview.1",
"version": "$(MACOS_SDK_VERSION)",
"supportedPlatforms": [ "Windows", "OSX" ]
},
{
"workloadId": "maui",
"workloadManifestId": "microsoft.net.sdk.maui",
"packageId": "Microsoft.NET.Sdk.Maui.Manifest-8.0.100",
"packageId": "Microsoft.NET.Sdk.Maui.Manifest-9.0.100-preview.1",
"version": "$(MAUI_VERSION)",
"supportedPlatforms": [ "Windows", "OSX" ]
}
Expand Down
Loading