|
| 1 | +# xamarin-android-tools tests stage |
| 2 | +# |
| 3 | +# Mirrors the build + test jobs from the upstream dotnet/android-tools |
| 4 | +# azure-pipelines.yaml so that the Xamarin.Android.Tools build + unit tests |
| 5 | +# continue to run as part of dotnet/android CI now that android-tools has been |
| 6 | +# merged in-tree under external/xamarin-android-tools/. |
| 7 | +# |
| 8 | +# The upstream pipeline also packed a NuGet and published build artifacts; |
| 9 | +# those are intentionally dropped here (the binaries aren't consumed from this |
| 10 | +# stage -- dotnet/android's own build produces the shipping assemblies). Only |
| 11 | +# logs + test results are surfaced. |
| 12 | +# |
| 13 | +# Referenced from both: |
| 14 | +# - build-tools/automation/azure-pipelines.yaml (official / 1ES) |
| 15 | +# - build-tools/automation/azure-pipelines-public.yaml (public PR validation) |
| 16 | + |
| 17 | +parameters: |
| 18 | +- name: stageName |
| 19 | + type: string |
| 20 | + default: xamarin_android_tools_tests |
| 21 | +- name: dependsOn |
| 22 | + type: object |
| 23 | + default: [] |
| 24 | +- name: condition |
| 25 | + type: string |
| 26 | + default: succeeded() |
| 27 | +- name: windowsPool |
| 28 | + type: object |
| 29 | + # NOTE: This default is a Microsoft-hosted Azure Pipelines pool, which is NOT |
| 30 | + # allowed by 1ES Pipeline Templates in Official mode. Callers that extend the |
| 31 | + # 1ES Official template (e.g. build-tools/automation/azure-pipelines.yaml) must |
| 32 | + # override this with a 1ES-hosted pool like `MAUI-1ESPT`. |
| 33 | + default: |
| 34 | + name: Azure Pipelines |
| 35 | + vmImage: $(HostedWinImage) |
| 36 | + os: windows |
| 37 | +- name: macPool |
| 38 | + type: object |
| 39 | + default: |
| 40 | + name: Azure Pipelines |
| 41 | + vmImage: $(HostedMacImage) |
| 42 | + os: macOS |
| 43 | + |
| 44 | +stages: |
| 45 | +- stage: ${{ parameters.stageName }} |
| 46 | + displayName: Android Tools Tests |
| 47 | + dependsOn: ${{ parameters.dependsOn }} |
| 48 | + condition: ${{ parameters.condition }} |
| 49 | + variables: |
| 50 | + DotNetCoreVersion: 10.0.x |
| 51 | + XatSourceDirectory: $(System.DefaultWorkingDirectory)/external/xamarin-android-tools |
| 52 | + # When built in-tree, external/xamarin-android-tools.override.props imports |
| 53 | + # dotnet/android's root Directory.Build.props, which pins |
| 54 | + # DotNetTargetFrameworkVersion=11.0 and sets AndroidToolsDisableMultiTargeting=true |
| 55 | + # (so the product build gets a single netstandard2.0 assembly). Upstream |
| 56 | + # dotnet/android-tools CI instead builds standalone: multi-targeting |
| 57 | + # netstandard2.0 + net10.0, with the test projects running on net10.0. Its |
| 58 | + # ProcessUtils tests assert ProcessStartInfo.ArgumentList, which only exists on |
| 59 | + # the net10.0 (NET5_0_OR_GREATER) build -- the netstandard2.0 build takes the |
| 60 | + # string-Arguments path. To reproduce upstream's green test configuration we |
| 61 | + # re-enable multi-targeting and force net10.0 via these global properties. |
| 62 | + XatBuildProperties: -p:AndroidToolsDisableMultiTargeting=false -p:DotNetTargetFrameworkVersion=10.0 |
| 63 | + jobs: |
| 64 | + |
| 65 | + # Check - "Xamarin.Android (Android Tools Tests Windows - .NET)" |
| 66 | + - job: xamarin_android_tools_windows |
| 67 | + displayName: Windows - .NET |
| 68 | + pool: ${{ parameters.windowsPool }} |
| 69 | + timeoutInMinutes: 30 |
| 70 | + workspace: |
| 71 | + clean: all |
| 72 | + steps: |
| 73 | + - checkout: self |
| 74 | + clean: true |
| 75 | + |
| 76 | + - task: UseDotNet@2 |
| 77 | + displayName: Use .NET Core $(DotNetCoreVersion) |
| 78 | + inputs: |
| 79 | + version: $(DotNetCoreVersion) |
| 80 | + |
| 81 | + - task: DotNetCoreCLI@2 |
| 82 | + displayName: Build Xamarin.Android.Tools.sln |
| 83 | + inputs: |
| 84 | + command: build |
| 85 | + projects: $(XatSourceDirectory)/Xamarin.Android.Tools.sln |
| 86 | + arguments: -c Debug $(XatBuildProperties) -bl:$(Build.ArtifactStagingDirectory)/build-windows.binlog |
| 87 | + |
| 88 | + - task: DotNetCoreCLI@2 |
| 89 | + displayName: Run Tests |
| 90 | + inputs: |
| 91 | + command: test |
| 92 | + projects: $(XatSourceDirectory)/bin/TestDebug/**/*-Tests.dll |
| 93 | + |
| 94 | + - task: PublishBuildArtifacts@1 |
| 95 | + displayName: Upload build logs |
| 96 | + condition: always() |
| 97 | + inputs: |
| 98 | + pathToPublish: $(Build.ArtifactStagingDirectory) |
| 99 | + artifactName: android-tools-logs-windows |
| 100 | + |
| 101 | + # Check - "Xamarin.Android (Android Tools Tests Mac - .NET)" |
| 102 | + - job: xamarin_android_tools_mac |
| 103 | + displayName: Mac - .NET |
| 104 | + pool: ${{ parameters.macPool }} |
| 105 | + timeoutInMinutes: 30 |
| 106 | + workspace: |
| 107 | + clean: all |
| 108 | + steps: |
| 109 | + - checkout: self |
| 110 | + clean: true |
| 111 | + |
| 112 | + - task: UseDotNet@2 |
| 113 | + displayName: Use .NET Core $(DotNetCoreVersion) |
| 114 | + inputs: |
| 115 | + version: $(DotNetCoreVersion) |
| 116 | + |
| 117 | + - task: DotNetCoreCLI@2 |
| 118 | + displayName: Build Xamarin.Android.Tools.sln |
| 119 | + inputs: |
| 120 | + command: build |
| 121 | + projects: $(XatSourceDirectory)/Xamarin.Android.Tools.sln |
| 122 | + arguments: -c Debug $(XatBuildProperties) -bl:$(Build.ArtifactStagingDirectory)/build-mac.binlog |
| 123 | + |
| 124 | + - task: DotNetCoreCLI@2 |
| 125 | + displayName: Run Tests |
| 126 | + inputs: |
| 127 | + command: test |
| 128 | + projects: $(XatSourceDirectory)/bin/TestDebug/**/*-Tests.dll |
| 129 | + |
| 130 | + - task: PublishBuildArtifacts@1 |
| 131 | + displayName: Upload build logs |
| 132 | + condition: always() |
| 133 | + inputs: |
| 134 | + pathToPublish: $(Build.ArtifactStagingDirectory) |
| 135 | + artifactName: android-tools-logs-mac |
0 commit comments