azure: move android environment setup into the bash script
@@ -9,21 +9,21 @@ parameters:
steps:
- bash: |
rustup target add ${{ parameters.target }}
- displayName: 'Install target ${{ parameters.target }}'
-
- - ${{ if eq(parameters.androidEnv, True) }}:
- - bash: |
- set -e
- echo "##vso[task.setvariable variable=CC_${{ parameters.target }}]${{ parameters.target }}$(androidNDK)-clang$(androidBinExt)"
- echo "##vso[task.setvariable variable=CC_aarch64_linux_android]${{ parameters.target }}$(androidNDK)-clang$(androidBinExt)"
- echo "##vso[task.setvariable variable=CXX_${{ parameters.target }}]${{ parameters.target }}$(androidNDK)-clang++$(androidBinExt)"
- echo "##vso[task.setvariable variable=CARGO_TARGET_${{ parameters.target }}_LINKER]${{ parameters.target }}$(androidNDK)-clang$(androidBinExt)"
- displayName: 'Set CC, CXX, and CARGO_LINKER target specific environment variables for Android'
+ displayName: 'Install Rust target ${{ parameters.target }}'
# Note: features are ignored when set in the workspace. This is a known bug in cargo (#5015), so cd into skia-safe instead.
# Also be sure that the bindings.rs file is rebuilt (https://github.com/rust-skia/rust-skia/issues/10)
- bash: |
set -e
+ if [ "${{ parameters.androidEnv }}" == "true" ]; then
+ TARGET=${{ parameters.target }}
+ TARGET=${TARGET//-/_}
+ export CC_${TARGET}=${{ parameters.target }}$(androidNDK)-clang$(androidBinExt)
+ export CXX_${TARGET}=${{ parameters.target }}$(androidNDK)-clang++$(androidBinExt)
+ export CARGO_TARGET_${TARGET}_LINKER=${{ parameters.target }}$(androidNDK)-clang$(androidBinExt)
+ echo "Set CC, CXX, and CARGO_LINKER target specific environment variables for Android"
+ fi
+ set
touch skia-bindings/build.rs
(cd skia-safe && cargo build --release --features "$(features)" --all-targets --target ${{ parameters.target }} -vv)
export SKIA_BINARIES_TAG=$(cat "$(Build.ArtifactStagingDirectory)/skia-binaries/tag.txt")
