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

feat: Bump preview manifest to 6.0.400 preview #73

Merged
merged 17 commits into from
Jun 17, 2022
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
74 changes: 69 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- release/**

jobs:
build:
build_tool:
name: Build
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:

testwin:
name: Validate Tool - Windows - ${{ matrix.manifest_name }}
needs: build
needs: build_tool
runs-on: windows-latest

strategy:
Expand All @@ -72,6 +72,14 @@ jobs:
manifest_name: Stable
- manifest: 'manifests\uno.ui-preview.manifest.json'
manifest_name: Preview
- manifest: 'manifests\uno.ui.manifest.json'
manifest_name: Stable Upgrade
previous_tool_version: 1.4.2
previous_tool_params: ''
- manifest: 'manifests\uno.ui-preview.manifest.json'
manifest_name: Preview Upgrade
previous_tool_version: 1.4.2
previous_tool_params: '--pre'

steps:
- name: Checkout
Expand Down Expand Up @@ -101,6 +109,17 @@ jobs:
useConfigFile: true
configFilePath: gitversion.yml

- name: Install and Run Previous Tool
if: ${{ contains(matrix.previous_tool_version, '.') }}
shell: pwsh
run: |
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet --list-sdks
& dotnet tool install --global --version ${{ matrix.previous_tool_version }} uno.check
& uno-check --ci --fix --non-interactive --verbose --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 ${{ matrix.previous_tool_params }}
& dotnet tool uninstall --global uno.check

- name: Install and Run Tool
shell: pwsh
run: |
Expand All @@ -112,7 +131,7 @@ jobs:

testmac:
name: Validate Tool - macOS - ${{ matrix.manifest_name }}/${{ matrix.os }}
needs: build
needs: build_tool

strategy:
matrix:
Expand All @@ -136,7 +155,20 @@ jobs:

- manifest: 'manifests/uno.ui-preview.manifest.json'
manifest_name: Preview
previous_tool_version: ''
previous_tool_params: ''

- manifest: 'manifests/uno.ui.manifest.json'
manifest_name: Stable Upgrade
previous_tool_version: 1.4.2
previous_tool_params: ''

- manifest: 'manifests/uno.ui-preview.manifest.json'
manifest_name: Preview Upgrade
previous_tool_version: 1.4.2
previous_tool_params: '--pre'


runs-on: ${{ matrix.os }}

steps:
Expand Down Expand Up @@ -172,6 +204,17 @@ jobs:
run: |
brew install gtk+3

- name: Install and Run Previous Tool
if: ${{ contains(matrix.previous_tool_version, '.') }}
shell: pwsh
run: |
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet --list-sdks
& dotnet tool install --global --version ${{ matrix.previous_tool_version }} uno.check
& uno-check --ci --fix --non-interactive --verbose --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 ${{ matrix.previous_tool_params }}
& dotnet tool uninstall --global uno.check

- name: Install and Run Tool
shell: pwsh
run: |
Expand All @@ -183,7 +226,7 @@ jobs:

testlinux:
name: Validate Tool - Linux - ${{ matrix.manifest_name }}
needs: build
needs: build_tool
runs-on: ubuntu-latest

strategy:
Expand All @@ -193,6 +236,15 @@ jobs:
manifest_name: Stable
- manifest: 'manifests/uno.ui-preview.manifest.json'
manifest_name: Preview

- manifest: 'manifests/uno.ui.manifest.json'
manifest_name: Stable Upgrade
previous_tool_version: 1.4.2
previous_tool_params: ''
- manifest: 'manifests/uno.ui-preview.manifest.json'
manifest_name: Preview Upgrade
previous_tool_version: 1.4.2
previous_tool_params: '--pre'

steps:
- name: Checkout
Expand Down Expand Up @@ -228,20 +280,32 @@ jobs:
sudo apt update
sudo apt install libgtk-3-dev

- name: Install and Run Previous Tool
if: ${{ contains(matrix.previous_tool_version, '.') }}
shell: pwsh
run: |
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet --list-sdks
& dotnet tool install --global --version ${{ matrix.previous_tool_version }} uno.check
& uno-check --ci --fix --non-interactive --verbose --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 ${{ matrix.previous_tool_params }}
& dotnet tool uninstall --global uno.check

- name: Install and Run Tool
shell: pwsh
run: |
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 }}


publish:
name: Publish
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) }}
runs-on: windows-latest
needs:
- build
- build_tool
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
8 changes: 4 additions & 4 deletions UnoCheck/AcquirePackagesCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ public override async Task<int> ExecuteAsync(CommandContext context, AcquirePack
var manifests = nugetWorkloadManifestProvider.GetManifests();
foreach (var mfst in manifests)
{
AnsiConsole.MarkupLine($"Acquiring packages for: {mfst.manifestId} ...");
AnsiConsole.MarkupLine($"Acquiring packages for: {mfst.ManifestId} ...");

var manifestReader = WorkloadManifestReader.ReadWorkloadManifest(mfst.manifestId, mfst.openManifestStream());
var manifestReader = WorkloadManifestReader.ReadWorkloadManifest(mfst.ManifestId, mfst.OpenManifestStream(), mfst.ManifestPath);

foreach (var wlPack in manifestReader.Packs)
{
Expand Down Expand Up @@ -310,8 +310,8 @@ public async Task ParseManifestPackages(string directory, List<Manifest.DotNetWo
public IEnumerable<string> GetManifestDirectories()
=> manifestDirs.Select(m => m.dir);

public IEnumerable<(string manifestId, string informationalPath, Func<Stream> openManifestStream, Func<Stream> openLocalizationStream)> GetManifests()
=> manifestDirs.Select(m => (m.id, m.dir, new Func<Stream>(() => File.OpenRead(m.file)), new Func<Stream>(() => null)));
public IEnumerable<ReadableWorkloadManifest> GetManifests()
=> manifestDirs.Select(m => new ReadableWorkloadManifest(m.id, m.dir, new Func<Stream>(() => File.OpenRead(m.file)), new Func<Stream>(() => null)));

public string GetSdkFeatureBand()
=> $"{SdkVersion.Major}.{SdkVersion.Minor}.{SdkVersion.Patch}";
Expand Down
38 changes: 32 additions & 6 deletions UnoCheck/Checkups/DotNetWorkloadsCheckup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,42 @@ public override async Task<DiagnosticResult> Examine(SharedState history)
if (force)
wasForceRunAlready = true;

var workloadManager = new DotNetWorkloadManager(SdkRoot, sdkVersion, NuGetPackageSources);

var validWorkloads = RequiredWorkloads
.Where(w => w.SupportedPlatforms?.Contains(Util.Platform) ?? false)
.ToArray();

var installedPackageWorkloads = workloadManager.GetInstalledWorkloads();
var workloadManagers = validWorkloads
.Select(w => w.Version.Split("/", StringSplitOptions.None).LastOrDefault() is { Length: > 0 } workloadSdkVersion ? workloadSdkVersion : sdkVersion)
.Concat(new[] { sdkVersion })
.Distinct()
.ToDictionary(v => v, v => new DotNetWorkloadManager(SdkRoot, v, NuGetPackageSources));

var missingWorkloads = new List<Manifest.DotNetWorkload>();

foreach (var rp in RequiredWorkloads.Where(w => w.SupportedPlatforms?.Contains(Util.Platform) ?? false))
{
if (!NuGetVersion.TryParse(rp.Version, out var rpVersion))
var versionParts = rp.Version.Split("/", StringSplitOptions.None);
var workloadVersion = versionParts.First();
var workloadSdkVersion = versionParts.ElementAtOrDefault(1) is { Length: > 0 } v ? v : sdkVersion;

if (!workloadManagers.TryGetValue(workloadSdkVersion, out var workloadManager))
{
throw new Exception($"Unable to find workload manager for version [{rp.Id}: {rp.Version}]");
}

var installedPackageWorkloads = workloadManager.GetInstalledWorkloads();

if (!NuGetVersion.TryParse(workloadVersion, out var rpVersion))
rpVersion = new NuGetVersion(0, 0, 0);

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

// TODO: Eventually check actual workload resolver api for installed workloads and
// compare the manifest version once it has a string in it
if (!installedPackageWorkloads.Any(ip => ip.id.Equals(rp.Id, StringComparison.OrdinalIgnoreCase) && NuGetVersion.TryParse(ip.version, out var ipVersion) && ipVersion == rpVersion))
Expand All @@ -83,7 +107,9 @@ public override async Task<DiagnosticResult> Examine(SharedState history)
if (!missingWorkloads.Any() && !force)
return DiagnosticResult.Ok(this);

return new DiagnosticResult(
var genericWorkloadManager = new DotNetWorkloadManager(SdkRoot, sdkVersion, NuGetPackageSources);

return new DiagnosticResult(
Status.Error,
this,
new Suggestion("Install or Update SDK Workloads",
Expand All @@ -93,15 +119,15 @@ public override async Task<DiagnosticResult> Examine(SharedState history)
{
try
{
await workloadManager.Repair();
await genericWorkloadManager.Repair();
}
catch (Exception ex)
{
ReportStatus("Warning: Workload repair failed", Status.Warning);
}
}

await workloadManager.Install(RequiredWorkloads);
await genericWorkloadManager.Install(RequiredWorkloads);
})));
}
}
Expand Down
10 changes: 5 additions & 5 deletions UnoCheck/DotNet/DotNetWorkloadManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ Dictionary<string, string> GetInstalledWorkloadManifestIdsAndVersions()

foreach (var manifestInfo in manifestProvider.GetManifests())
{
using (var manifestStream = manifestInfo.openManifestStream())
using (var manifestStream = manifestInfo.OpenManifestStream())
{
var m = WorkloadManifestReader.ReadWorkloadManifest(manifestInfo.manifestId, manifestStream);
items[manifestInfo.manifestId] = m.Version;
var m = WorkloadManifestReader.ReadWorkloadManifest(manifestInfo.ManifestId, manifestStream, manifestInfo.ManifestPath);
items[manifestInfo.ManifestId] = m.Version;
}
}

Expand All @@ -112,9 +112,9 @@ Dictionary<string, string> GetInstalledWorkloadManifestIdsAndVersions()

foreach (var manifestInfo in manifestProvider.GetManifests())
{
using (var manifestStream = manifestInfo.openManifestStream())
using (var manifestStream = manifestInfo.OpenManifestStream())
{
var m = WorkloadManifestReader.ReadWorkloadManifest(manifestInfo.manifestId, manifestStream);
var m = WorkloadManifestReader.ReadWorkloadManifest(manifestInfo.ManifestId, manifestStream, manifestInfo.ManifestPath);

// Each workload manifest can have one or more workloads defined
foreach (var wl in m.Workloads)
Expand Down
4 changes: 2 additions & 2 deletions UnoCheck/DotNet/DotNetWorkloadManagerLegacy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ async Task DeleteExistingWorkloads(string sdkRoot, string sdkVersion, string wor

foreach (var manifestInfo in manifestProvider.GetManifests())
{
using (var manifestStream = manifestInfo.openManifestStream())
using (var manifestStream = manifestInfo.OpenManifestStream())
{
var m = WorkloadManifestReader.ReadWorkloadManifest(manifestInfo.manifestId, manifestStream);
var m = WorkloadManifestReader.ReadWorkloadManifest(manifestInfo.ManifestId, manifestStream, manifestInfo.ManifestPath);

// Each workload manifest can have one or more workloads defined
foreach (var wl in m.Workloads)
Expand Down
3 changes: 1 addition & 2 deletions UnoCheck/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
"profiles": {
"UnoCheck": {
"commandName": "Project",
"commandLineArgs": "--verbose --pre"
"commandLineArgs": "--verbose --manifest C:\\s\\unoplatform\\uno.check\\manifests\\uno.ui-preview.manifest.json"
},
"WSL 2": {
"commandName": "WSL2",
"environmentVariables": {},
"distributionName": ""
}
}
Expand Down
2 changes: 2 additions & 0 deletions UnoCheck/UnoCheck.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
<PackageReference Include="NuGet.Versioning" Version="5.10.0" />
<PackageReference Include="Microsoft.Build.Framework" Version="16.9.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.7.1" />
<PackageReference Include="System.Text.Json" Version="5.0.2" />
<PackageReference Include="vswhere" Version="2.8.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
Binary file modified libs/Microsoft.DotNet.MSBuildSdkResolver.dll
Binary file not shown.
28 changes: 14 additions & 14 deletions manifests/uno.ui-preview.manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"check": {
"toolVersion": "1.2.0",
"toolVersion": "1.5.0",
"variables": {
"OPENJDK_VERSION": "11.0.10.9",
"DOTNET_SDK_VERSION": "6.0.300",
"MACCATALYST_SDK_VERSION": "15.4.303",
"IOS_SDK_VERSION": "15.4.303",
"TVOS_SDK_VERSION": "15.4.303",
"MACOS_SDK_VERSION": "12.3.303",
"ANDROID_SDK_VERSION": "32.0.301",
"MONO_TOOLCHAIN_VERSION": "6.0.5"
"DOTNET_SDK_VERSION": "6.0.400-preview.22301.10",
"MACCATALYST_SDK_VERSION": "15.4.414/6.0.400",
"IOS_SDK_VERSION": "15.4.414/6.0.400",
"TVOS_SDK_VERSION": "15.4.414/6.0.400",
"MACOS_SDK_VERSION": "12.3.414/6.0.400",
"ANDROID_SDK_VERSION": "32.0.415/6.0.300",
"MONO_TOOLCHAIN_VERSION": "6.0.6/6.0.300"
},
"variableMappers": [
],
Expand All @@ -25,7 +25,7 @@
"exactVersionName": "13.3"
},
"vswin": {
"minimumVersion": "17.3.0-pre.1.0"
"minimumVersion": "17.3.0-pre.2.0"
},
"vsmac": {
"minimumVersion": "8.10.0",
Expand Down Expand Up @@ -109,28 +109,28 @@
{
"workloadId": "ios",
"workloadManifestId": "microsoft.net.sdk.ios",
"packageId": "Microsoft.NET.Sdk.iOS.Manifest-6.0.300",
"packageId": "Microsoft.NET.Sdk.iOS.Manifest-6.0.400",
"version": "$(IOS_SDK_VERSION)",
"supportedPlatforms": [ "Windows", "OSX" ]
},
{
"workloadId": "maccatalyst",
"workloadManifestId": "microsoft.net.sdk.maccatalyst",
"packageId": "Microsoft.NET.Sdk.MacCatalyst.Manifest-6.0.300",
"packageId": "Microsoft.NET.Sdk.MacCatalyst.Manifest-6.0.400",
"version": "$(MACCATALYST_SDK_VERSION)",
"supportedPlatforms": [ "Windows", "OSX" ]
},
{
"workloadId": "tvos",
"workloadManifestId": "microsoft.net.sdk.tvos",
"packageId": "Microsoft.NET.Sdk.tvOS.Manifest-6.0.300",
"packageId": "Microsoft.NET.Sdk.tvOS.Manifest-6.0.400",
"version": "$(TVOS_SDK_VERSION)",
"supportedPlatforms": [ "Windows", "OSX" ]
},
{
"workloadId": "macos",
"workloadManifestId": "microsoft.net.sdk.macos",
"packageId": "Microsoft.NET.Sdk.macOS.Manifest-6.0.300",
"packageId": "Microsoft.NET.Sdk.macOS.Manifest-6.0.400",
"version": "$(MACOS_SDK_VERSION)",
"supportedPlatforms": [ "Windows", "OSX" ]
},
Expand Down Expand Up @@ -175,4 +175,4 @@
]
}
}
}
}