2019-02-09 21:23:09 +03:00
|
|
|
parameters:
|
2019-09-24 02:34:44 +03:00
|
|
|
name: '' # in the form type_platform_host
|
|
|
|
displayName: '' # the human name
|
|
|
|
vmImage: '' # the VM image
|
|
|
|
packages: '' # any additional packages
|
|
|
|
target: '' # the bootstrapper target
|
|
|
|
dependsOn: [] # the dependiencies
|
|
|
|
requiredArtifacts: [] # the artifacts that this build needs to download
|
|
|
|
demands: [] # the demands
|
|
|
|
preBuildSteps: [] # any steps to run before the build
|
|
|
|
postBuildSteps: [] # any additional steps to run after the build
|
2020-06-29 20:28:12 +03:00
|
|
|
initScript: '' # any scripts to run before starting the bootstrapper
|
2019-09-24 02:34:44 +03:00
|
|
|
additionalArgs: '' # any additional arguments to pass to the bootstrapper
|
|
|
|
retryCount: 1 # the number of times to retry the bootstrapper
|
|
|
|
condition: succeeded() # whether or not to run this template
|
|
|
|
shouldPublish: true # whether or not to publish the artifacts
|
2019-09-26 17:52:20 +03:00
|
|
|
configuration: $(CONFIGURATION) # the build configuration
|
2020-06-25 23:28:43 +03:00
|
|
|
buildExternals: '' # the build number to download externals from
|
2019-09-26 17:52:20 +03:00
|
|
|
verbosity: $(VERBOSITY) # the level of verbosity to use when building
|
2019-11-27 08:49:33 +03:00
|
|
|
docker: '' # the Docker image to build and use
|
2020-07-07 03:23:42 +03:00
|
|
|
dockerArgs: '' # any additional arguments to pass to docker build
|
2020-07-07 20:15:40 +03:00
|
|
|
installAndroidNdk: true # whether or not to install the Android NDK
|
|
|
|
installTizenSdk: true # whether or not to install the Tizen SDK
|
|
|
|
installWindowsSdk: true # whether or not to install the Windows SDK
|
|
|
|
installLlvm: true # whether or not to install the LLVM compiler
|
2020-07-20 13:21:44 +03:00
|
|
|
installEmsdk: false # whether or not to install the Emscripten SDK
|
2019-02-09 21:23:09 +03:00
|
|
|
|
|
|
|
jobs:
|
2020-06-25 23:28:43 +03:00
|
|
|
# - ${{ if and(ne(parameters.buildExternals, ''), startsWith(parameters.name, 'native_')) }}:
|
|
|
|
# - template: azure-templates-download.yml
|
|
|
|
# parameters:
|
|
|
|
# name: ${{ parameters.name }}
|
|
|
|
# displayName: ${{ parameters.displayName }}
|
|
|
|
# vmImage: ${{ parameters.vmImage }}
|
|
|
|
# condition: ${{ parameters.condition }}
|
|
|
|
# buildExternals: ${{ parameters.buildExternals }}
|
2019-09-24 02:34:44 +03:00
|
|
|
|
2020-06-25 23:28:43 +03:00
|
|
|
# - ${{ if or(eq(parameters.buildExternals, ''), not(startsWith(parameters.name, 'native_'))) }}:
|
2019-02-09 21:23:09 +03:00
|
|
|
- job: ${{ parameters.name }}
|
|
|
|
displayName: ${{ parameters.displayName }}
|
|
|
|
timeoutInMinutes: 120
|
|
|
|
pool:
|
2020-07-20 13:21:44 +03:00
|
|
|
vmImage: ${{ parameters.vmImage }}
|
2019-03-19 16:09:27 +03:00
|
|
|
demands: ${{ parameters.demands }}
|
2019-02-09 21:23:09 +03:00
|
|
|
dependsOn: ${{ parameters.dependsOn }}
|
2019-07-13 06:14:48 +03:00
|
|
|
condition: ${{ parameters.condition }}
|
2019-02-09 21:23:09 +03:00
|
|
|
steps:
|
2020-03-14 04:24:10 +03:00
|
|
|
# prepare
|
2019-02-15 00:04:20 +03:00
|
|
|
- checkout: self
|
|
|
|
submodules: recursive
|
2019-11-27 08:49:33 +03:00
|
|
|
- template: azure-templates-variables.yml
|
2020-03-14 04:24:10 +03:00
|
|
|
|
2019-02-09 21:23:09 +03:00
|
|
|
# install any packages on linux
|
2020-06-17 20:15:50 +03:00
|
|
|
- ${{ if and(eq(parameters.docker, ''), endsWith(parameters.name, '_linux')) }}:
|
2019-02-09 21:23:09 +03:00
|
|
|
- bash: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install -y ${{ parameters.packages }}
|
2019-11-27 08:49:33 +03:00
|
|
|
displayName: Install additional package dependencies
|
|
|
|
condition: ne('${{ parameters.packages }}', '')
|
2020-03-14 04:24:10 +03:00
|
|
|
|
2020-02-01 20:11:24 +03:00
|
|
|
# make sure mono/msbuild is the correct version
|
2020-06-17 20:15:50 +03:00
|
|
|
- ${{ if and(eq(parameters.docker, ''), endsWith(parameters.name, '_linux')) }}:
|
2020-02-01 20:11:24 +03:00
|
|
|
- bash: |
|
|
|
|
sudo apt remove -y mono-complete msbuild
|
|
|
|
sudo apt autoremove -y
|
|
|
|
sudo rm /etc/mono/config
|
|
|
|
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
|
|
|
|
echo "deb https://download.mono-project.com/repo/ubuntu $(MONO_VERSION_LINUX) main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install -y mono-complete msbuild
|
|
|
|
mono --version
|
|
|
|
displayName: Install Mono and MSBuild
|
2020-03-14 04:24:10 +03:00
|
|
|
- ${{ if endsWith(parameters.name, '_macos') }}:
|
|
|
|
- bash: sudo $(Agent.HomeDirectory)/scripts/select-xamarin-sdk.sh $(MONO_VERSION_MACOS)
|
|
|
|
displayName: Switch to the latest Xamarin SDK
|
|
|
|
|
2019-02-09 21:23:09 +03:00
|
|
|
# install extra bits for the native builds
|
|
|
|
- ${{ if startsWith(parameters.name, 'native_') }}:
|
|
|
|
# switch to Python 2.7
|
|
|
|
- task: UsePythonVersion@0
|
2019-02-11 21:21:23 +03:00
|
|
|
displayName: Switch to Python to 2.7
|
2019-02-09 21:23:09 +03:00
|
|
|
inputs:
|
|
|
|
versionSpec: '2.7'
|
|
|
|
architecture: 'x64'
|
2020-03-14 04:24:10 +03:00
|
|
|
- ${{ if not(contains(parameters.name, '_checks_')) }}:
|
|
|
|
# install android ndk
|
2020-07-07 20:15:40 +03:00
|
|
|
- ${{ if and(eq(parameters.installAndroidNdk, 'true'), contains(parameters.name, '_android_')) }}:
|
2020-03-14 04:24:10 +03:00
|
|
|
- pwsh: .\scripts\install-android-ndk.ps1
|
|
|
|
displayName: Install the Android NDK
|
|
|
|
# install tizen
|
2020-07-07 20:15:40 +03:00
|
|
|
- ${{ if and(eq(parameters.installTizenSdk, 'true'), contains(parameters.name, '_tizen_')) }}:
|
2020-03-14 04:24:10 +03:00
|
|
|
- pwsh: .\scripts\install-tizen.ps1
|
|
|
|
displayName: Install the Tizen SDK
|
|
|
|
# install llvm
|
2020-07-07 20:15:40 +03:00
|
|
|
- ${{ if and(eq(parameters.installLlvm, 'true'), contains(parameters.name, '_win32_')) }}:
|
2020-03-14 04:24:10 +03:00
|
|
|
- pwsh: .\scripts\install-llvm.ps1
|
|
|
|
displayName: Install LLVM
|
|
|
|
|
2019-09-24 02:34:44 +03:00
|
|
|
# install extra bits for the manged builds
|
|
|
|
- ${{ if not(startsWith(parameters.name, 'native_')) }}:
|
|
|
|
- task: UseDotNet@2
|
|
|
|
inputs:
|
|
|
|
packageType: 'sdk'
|
|
|
|
version: $(DOTNET_VERSION)
|
|
|
|
performMultiLevelLookup: true
|
|
|
|
displayName: Install the correct version of .NET Core
|
2020-03-14 04:24:10 +03:00
|
|
|
|
|
|
|
# install the mac tools
|
2019-05-01 03:19:56 +03:00
|
|
|
- ${{ if endsWith(parameters.name, '_macos') }}:
|
2019-02-09 21:23:09 +03:00
|
|
|
- bash: echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(XCODE_VERSION).app;sudo xcode-select --switch /Applications/Xcode_$(XCODE_VERSION).app/Contents/Developer
|
|
|
|
displayName: Switch to the latest Xcode
|
2020-03-14 04:24:10 +03:00
|
|
|
|
2020-07-20 13:21:44 +03:00
|
|
|
# install the linux tools
|
|
|
|
- ${{ if and(eq(parameters.installEmsdk, 'true'), endsWith(parameters.name, '_linux')) }}:
|
|
|
|
- bash: |
|
|
|
|
git clone --branch $(EMSCRIPTEN_VERSION) https://github.com/emscripten-core/emsdk ~/emsdk
|
|
|
|
~/emsdk/emsdk install $(EMSCRIPTEN_VERSION)
|
|
|
|
~/emsdk/emsdk activate $(EMSCRIPTEN_VERSION)
|
|
|
|
displayName: Install the Emscripten SDK
|
|
|
|
|
2020-03-14 04:24:10 +03:00
|
|
|
# install the Windows tools
|
|
|
|
- ${{ if endsWith(parameters.name, '_windows') }}:
|
|
|
|
- ${{ if not(contains(parameters.name, '_checks_')) }}:
|
|
|
|
# install the older Windows SDKs
|
2020-07-07 20:15:40 +03:00
|
|
|
- ${{ if eq(parameters.installWindowsSdk, 'true') }}:
|
2020-03-14 04:24:10 +03:00
|
|
|
- pwsh: |
|
|
|
|
$uri = 'https://go.microsoft.com/fwlink/p/?LinkId=619296'
|
|
|
|
.\scripts\download-file.ps1 -Uri $uri -OutFile sdksetup.exe
|
|
|
|
.\sdksetup.exe /norestart /quiet | Out-Null
|
|
|
|
displayName: Install the Windows 10 SDK 10.0.10240
|
|
|
|
|
2020-06-25 18:14:30 +03:00
|
|
|
# install any .NET Core global tools
|
|
|
|
- ${{ each tool in parameters.tools }}:
|
|
|
|
- pwsh: dotnet tool install -g ${{ tool }}
|
|
|
|
displayName: Install ${{ tool }}
|
|
|
|
|
2019-02-09 21:23:09 +03:00
|
|
|
# download artifacts
|
2019-07-13 06:14:48 +03:00
|
|
|
- ${{ each dep in parameters.requiredArtifacts }}:
|
2019-07-26 16:05:54 +03:00
|
|
|
- task: DownloadBuildArtifacts@0
|
2019-02-09 21:23:09 +03:00
|
|
|
displayName: Download the ${{ dep }} artifacts
|
|
|
|
inputs:
|
|
|
|
artifactName: ${{ dep }}
|
2019-07-26 16:05:54 +03:00
|
|
|
downloadPath: 'download-temp'
|
2019-11-05 20:38:03 +03:00
|
|
|
- pwsh: |
|
2019-07-26 16:05:54 +03:00
|
|
|
New-Item '.\output\' -Type Directory -Force | Out-Null
|
|
|
|
Get-ChildItem '.\download-temp\${{ dep }}\' | Copy-Item -Destination '.\output\' -Recurse -Force
|
|
|
|
Remove-Item '.\download-temp\${{ dep }}\' -Recurse -Force
|
|
|
|
displayName: Move the ${{ dep }} artifacts to the output directory
|
2020-03-14 04:24:10 +03:00
|
|
|
|
2019-02-09 21:23:09 +03:00
|
|
|
# pre-build steps
|
|
|
|
- ${{ parameters.preBuildSteps }}
|
2020-03-14 04:24:10 +03:00
|
|
|
|
2019-02-09 21:23:09 +03:00
|
|
|
# build
|
2019-11-27 08:49:33 +03:00
|
|
|
- ${{ if eq(parameters.docker, '') }}:
|
|
|
|
- ${{ if endsWith(parameters.name, '_windows') }}:
|
2020-06-29 20:28:12 +03:00
|
|
|
- pwsh: |
|
|
|
|
${{ parameters.initScript }}
|
|
|
|
.\scripts\retry-command.ps1 -RetryCount ${{ parameters.retryCount }} {
|
|
|
|
.\bootstrapper.ps1 -t ${{ parameters.target }} -v ${{ parameters.verbosity }} -c ${{ coalesce(parameters.configuration, 'Release') }} ${{ parameters.additionalArgs }}
|
|
|
|
}
|
2019-11-27 08:49:33 +03:00
|
|
|
env:
|
|
|
|
JavaSdkDirectory: $(JAVA_HOME)
|
|
|
|
LLVM_HOME: $(LLVM_HOME)
|
2020-03-15 16:24:45 +03:00
|
|
|
# There seems to be a bug in some verions of mspdbcmf.exe. This looks to be fixed in a VS preview.
|
|
|
|
AppxSymbolPackageEnabled: false
|
2019-11-27 08:49:33 +03:00
|
|
|
displayName: Run the bootstrapper for ${{ parameters.target }}
|
|
|
|
- ${{ if not(endsWith(parameters.name, '_windows')) }}:
|
2020-06-29 20:28:12 +03:00
|
|
|
- bash: |
|
|
|
|
${{ parameters.initScript }}
|
|
|
|
./scripts/retry-command.sh ${{ parameters.retryCount }} \
|
|
|
|
./bootstrapper.sh -t ${{ parameters.target }} -v ${{ parameters.verbosity }} -c ${{ coalesce(parameters.configuration, 'Release') }} ${{ parameters.additionalArgs }}
|
2019-11-27 08:49:33 +03:00
|
|
|
env:
|
|
|
|
JavaSdkDirectory: $(JAVA_HOME)
|
|
|
|
displayName: Run the bootstrapper for ${{ parameters.target }}
|
|
|
|
- ${{ if ne(parameters.docker, '') }}:
|
2020-07-07 03:23:42 +03:00
|
|
|
- bash: docker build --tag skiasharp ${{ parameters.dockerArgs }} .
|
2019-11-27 08:49:33 +03:00
|
|
|
workingDirectory: ${{ parameters.docker }}
|
|
|
|
displayName: Build the Docker image for ${{ parameters.docker }}
|
2020-06-29 20:28:12 +03:00
|
|
|
- bash: |
|
|
|
|
docker run --rm --name skiasharp --volume $(pwd):/work skiasharp /bin/bash \
|
|
|
|
scripts/retry-command.sh ${{ parameters.retryCount }} \
|
|
|
|
./bootstrapper.sh -t ${{ parameters.target }} -v ${{ parameters.verbosity }} -c ${{ coalesce(parameters.configuration, 'Release') }} ${{ parameters.additionalArgs }}
|
2019-11-27 08:49:33 +03:00
|
|
|
displayName: Run the bootstrapper for ${{ parameters.target }} using the Docker image
|
2020-03-14 04:24:10 +03:00
|
|
|
|
2019-02-09 21:23:09 +03:00
|
|
|
# post-build steps
|
|
|
|
- ${{ parameters.postBuildSteps }}
|
2020-03-14 04:24:10 +03:00
|
|
|
|
2019-02-09 21:23:09 +03:00
|
|
|
# publish artifacts
|
2019-07-26 16:05:54 +03:00
|
|
|
- task: PublishBuildArtifacts@1
|
2019-02-09 21:23:09 +03:00
|
|
|
displayName: Publish the ${{ parameters.name }} artifacts
|
2019-07-13 06:14:48 +03:00
|
|
|
condition: ${{ parameters.shouldPublish }}
|
2019-02-09 21:23:09 +03:00
|
|
|
inputs:
|
|
|
|
artifactName: ${{ parameters.name }}
|
2019-07-26 16:05:54 +03:00
|
|
|
pathToPublish: 'output'
|
2019-11-27 19:47:17 +03:00
|
|
|
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
|
|
|
|
- task: ComponentGovernanceComponentDetection@0
|
|
|
|
displayName: Run component detection
|
|
|
|
condition: always()
|
|
|
|
inputs:
|
|
|
|
scanType: 'Register'
|
|
|
|
verbosity: 'Verbose'
|
|
|
|
alertWarningLevel: 'High'
|