From 4cf5fc1804c4d574651c62f39c9c3ea588d2d026 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Fri, 12 Aug 2022 14:51:19 -0400 Subject: [PATCH 1/3] [ci] Add support to net6.0 for multi-targeting in VS Context: https://github.com/xamarin/yaml-templates/pull/180 Context: https://github.com/xamarin/yaml-templates/pull/195 Context: https://github.com/xamarin/yaml-templates/pull/199 Updates the build to use the latest MSI generation template. The v3 template uses the latest changes from arcade which include a large refactoring, support for multi-targeting, and support for workload pack group MSIs. The build will now produce two different VS Drop artifacts. The MSI and VSMAN files generated for SDK packs have been split out into a new `vsdrop-multitarget-signed` artifact, allowing us to include multiple versions of the SDK packs in VS. The `Microsoft.Android.Sdk` pack has been renamed to `Microsoft.Android.Sdk.net6` to match the pack alias that is referenced in the .NET 7 manifest. --- build-tools/automation/azure-pipelines.yaml | 17 +++++++++++++++-- build-tools/create-packs/vs-workload.in.props | 1 + .../WorkloadManifest.in.json | 4 ++-- .../WorkloadManifest.targets | 2 +- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index e86ecdec80f..24e11bd3c6d 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -1409,7 +1409,7 @@ stages: usePipelineArtifactTasks: true # Check - "Xamarin.Android (Prepare .NET Release Convert NuGet to MSI)" - - template: nuget-msi-convert/job/v2.yml@yaml + - template: nuget-msi-convert/job/v3.yml@yaml parameters: yamlResourceName: yaml dependsOn: sign_net_mac_win @@ -1418,7 +1418,6 @@ stages: !*Darwin* propsArtifactName: nuget-unsigned signType: $(MicroBuildSignType) - runInParallel: false # Check - "Xamarin.Android (Prepare .NET Release Push Internal)" - job: push_signed_nugets @@ -1484,6 +1483,20 @@ stages: artifactName: vsdrop-signed downloadPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName) + - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions + parameters: + githubToken: $(GitHub.Token) + githubContext: $(MultiTargetVSDropCommitStatusName) + blobName: $(MultiTargetVSDropCommitStatusName) + packagePrefix: xamarin-android + artifactsPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName) + yamlResourceName: yaml + downloadSteps: + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: vsdrop-multitarget-signed + downloadPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName) + - powershell: >- & dotnet build -v:n -c $(XA.Build.Configuration) -t:PushManifestToBuildAssetRegistry diff --git a/build-tools/create-packs/vs-workload.in.props b/build-tools/create-packs/vs-workload.in.props index 861514fa0a3..0eec688069e 100644 --- a/build-tools/create-packs/vs-workload.in.props +++ b/build-tools/create-packs/vs-workload.in.props @@ -11,5 +11,6 @@ + diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json index 37a5a740487..bdbbb716417 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json @@ -4,7 +4,7 @@ "android": { "description": ".NET SDK Workload for building Android applications.", "packs": [ - "Microsoft.Android.Sdk", + "Microsoft.Android.Sdk.net6", "Microsoft.Android.Ref.31", "Microsoft.Android.Runtime.31.android-arm", "Microsoft.Android.Runtime.31.android-arm64", @@ -41,7 +41,7 @@ } }, "packs": { - "Microsoft.Android.Sdk": { + "Microsoft.Android.Sdk.net6": { "kind": "sdk", "version": "@WORKLOAD_VERSION@", "alias-to": { diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.targets index fcbee9812bf..4a5f06fe7fa 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.targets @@ -1,5 +1,5 @@ - From f7eda83c8c716472fb3a563625e5ed4ddc43afed Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 25 Aug 2022 13:06:51 -0400 Subject: [PATCH 2/3] Bump Xamarin.Legacy.Sdk, only run One .NET smoke tests --- build-tools/automation/azure-pipelines.yaml | 10 +++++++--- .../Tests/Xamarin.Android.Build.Tests/XASdkTests.cs | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 24e11bd3c6d..1433fcc0b3b 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -715,14 +715,18 @@ stages: - template: yaml-templates/run-msbuild-mac-tests.yaml parameters: job_name: mac_msbuild_tests_0 - nunit_categories: '|| cat == SmokeTests' + job_suffix: One .NET + nunit_categories: '| (TestCategory = SmokeTests $(DotNetNUnitCategories))' + target_framework: 'net6.0' provisionatorChannel: ${{ parameters.provisionatorChannel }} # Xamarin.Android (Smoke Tests MSBuild - Win-0) - template: yaml-templates\run-msbuild-win-tests.yaml parameters: - job_name: win_msbuild_tests_0 - nunit_categories: '|| cat == SmokeTests' + job_name: win_dotnet_tests_0 + job_suffix: One .NET + nunit_categories: '| (TestCategory = SmokeTests $(DotNetNUnitCategories))' + target_framework: 'net6.0' provisionatorChannel: ${{ parameters.provisionatorChannel }} # Check - "Xamarin.Android (Smoke Tests MSBuild Emulator - macOS)" diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs index 44c4fc20f4f..0b4d697b3ad 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs @@ -837,7 +837,7 @@ void CreateEmptyFile (params string [] paths) public void XamarinLegacySdk ([Values ("net6.0-android32.0", "net6.0-android33.0")] string dotnetTargetFramework) { var proj = new XASdkProject (outputType: "Library") { - Sdk = "Xamarin.Legacy.Sdk/0.2.0-alpha1", + Sdk = "Xamarin.Legacy.Sdk/0.2.0-alpha2", Sources = { new AndroidItem.AndroidLibrary ("javaclasses.jar") { BinaryContent = () => ResourceData.JavaSourceJarTestJar, From 3dec896524265e5e4b0c742b068974311c3c5554 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 25 Aug 2022 13:09:25 -0400 Subject: [PATCH 3/3] Use the same msi versioning schema --- build-tools/automation/azure-pipelines.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 1433fcc0b3b..948e0654873 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -1422,6 +1422,7 @@ stages: !*Darwin* propsArtifactName: nuget-unsigned signType: $(MicroBuildSignType) + useDateTimeVersion: false # Check - "Xamarin.Android (Prepare .NET Release Push Internal)" - job: push_signed_nugets