diff --git a/build-tools/automation/yaml-templates/build-windows.yaml b/build-tools/automation/yaml-templates/build-windows.yaml index b94bb97c15b..485ab749bdf 100644 --- a/build-tools/automation/yaml-templates/build-windows.yaml +++ b/build-tools/automation/yaml-templates/build-windows.yaml @@ -86,7 +86,10 @@ stages: displayName: Build Solution continueOnError: false - - template: install-apkdiff.yaml + - template: install-global-tool.yaml + parameters: + toolName: apkdiff + version: $(ApkDiffToolVersion) - template: run-nunit-tests.yaml parameters: diff --git a/build-tools/automation/yaml-templates/install-dotnet-test-slicer.yaml b/build-tools/automation/yaml-templates/install-dotnet-test-slicer.yaml deleted file mode 100644 index 8f2080abe3c..00000000000 --- a/build-tools/automation/yaml-templates/install-dotnet-test-slicer.yaml +++ /dev/null @@ -1,22 +0,0 @@ -parameters: - version: '0.1.0-alpha5' - condition: succeeded() - continueOnError: true - -steps: -- powershell: dotnet tool uninstall dotnet-test-slicer -g - displayName: uninstall dotnet-test-slicer - ignoreLASTEXITCODE: true - condition: ${{ parameters.condition }} - -- task: DotNetCoreCLI@2 - displayName: install dotnet-test-slicer ${{ parameters.version }} - condition: ${{ parameters.condition }} - continueOnError: ${{ parameters.continueOnError }} - inputs: - command: custom - custom: tool - arguments: >- - update dotnet-test-slicer -g - --version ${{ parameters.version }} - --add-source "https://api.nuget.org/v3/index.json" diff --git a/build-tools/automation/yaml-templates/install-apkdiff.yaml b/build-tools/automation/yaml-templates/install-global-tool.yaml similarity index 61% rename from build-tools/automation/yaml-templates/install-apkdiff.yaml rename to build-tools/automation/yaml-templates/install-global-tool.yaml index 8984b80ac45..69ac8c28583 100644 --- a/build-tools/automation/yaml-templates/install-apkdiff.yaml +++ b/build-tools/automation/yaml-templates/install-global-tool.yaml @@ -1,22 +1,23 @@ parameters: - version: '0.0.15' + toolName: '' + version: '' condition: succeeded() continueOnError: true steps: -- powershell: dotnet tool uninstall apkdiff -g - displayName: uninstall apkdiff +- powershell: dotnet tool uninstall ${{ parameters.toolName }} -g + displayName: uninstall ${{ parameters.toolName }} ignoreLASTEXITCODE: true condition: ${{ parameters.condition }} - task: DotNetCoreCLI@2 - displayName: install apkdiff ${{ parameters.version }} + displayName: install ${{ parameters.toolName }} ${{ parameters.version }} condition: ${{ parameters.condition }} continueOnError: ${{ parameters.continueOnError }} inputs: command: custom custom: tool arguments: >- - update apkdiff -g + update ${{ parameters.toolName }} -g --version ${{ parameters.version }} --add-source "https://api.nuget.org/v3/index.json" diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml index 34602aedfed..6b98286ab37 100644 --- a/build-tools/automation/yaml-templates/setup-test-environment.yaml +++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml @@ -68,15 +68,11 @@ steps: xaSourcePath: ${{ parameters.xaSourcePath }} - ${{ if eq(parameters.installLegacyXamarinAndroid, true) }}: - - task: DotNetCoreCLI@2 - displayName: install boots 1.1.0.36 - inputs: - command: custom - custom: tool - arguments: >- - update boots -g - --version 1.1.0.36 - --add-source "https://api.nuget.org/v3/index.json" + - template: install-global-tool.yaml + parameters: + toolName: boots + version: $(BootsToolVersion) + continueOnError: false - powershell: boots --stable Xamarin.Android displayName: install Xamarin.Android stable @@ -120,7 +116,13 @@ steps: arguments: -t:ExtractWorkloadPacks -c ${{ parameters.configuration }} -v:n -bl:${{ parameters.xaSourcePath }}/bin/Test${{ parameters.configuration }}/extract-workloads.binlog - ${{ if eq(parameters.installApkDiff, true) }}: - - template: install-apkdiff.yaml + - template: install-global-tool.yaml + parameters: + toolName: apkdiff + version: $(ApkDiffToolVersion) - ${{ if eq(parameters.installTestSlicer, true) }}: - - template: install-dotnet-test-slicer.yaml + - template: install-global-tool.yaml + parameters: + toolName: dotnet-test-slicer + version: $(TestSlicerToolVersion) diff --git a/build-tools/automation/yaml-templates/variables.yaml b/build-tools/automation/yaml-templates/variables.yaml index 41045ca8d6f..41c64201b08 100644 --- a/build-tools/automation/yaml-templates/variables.yaml +++ b/build-tools/automation/yaml-templates/variables.yaml @@ -13,6 +13,12 @@ variables: value: test-assemblies - name: WindowsToolchainPdbArtifactName value: windows-toolchain-pdb +- name: ApkDiffToolVersion + value: 0.0.15 +- name: TestSlicerToolVersion + value: 0.1.0-alpha5 +- name: BootsToolVersion + value: 1.1.0.36 - name: NUnitConsoleVersion value: 3.16.3 - name: NUnit.NumberOfTestWorkers