mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-23 02:38:28 +00:00
Here's the motivating issue: https://github.com/microsoft/azure-pipelines-tasks/issues/10331 Noticed some problems in other repos so also updating usages in ORT. We may be fine now without it, but this change adds some safeguard against future additions of 'set -x' for debugging.
33 lines
1 KiB
YAML
33 lines
1 KiB
YAML
# Installs the Android NDK and sets environment variables ANDROID_NDK_HOME and ANDROID_NDK_ROOT to refer to it.
|
|
|
|
parameters:
|
|
- name: AndroidNdkVersion
|
|
type: string
|
|
default: "25.0.8775105" # LTS version
|
|
|
|
steps:
|
|
- bash: |
|
|
set -e
|
|
|
|
"${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager" --install "ndk;${{ parameters.AndroidNdkVersion }}"
|
|
|
|
NDK_PATH="${ANDROID_SDK_ROOT}/ndk/${{ parameters.AndroidNdkVersion }}"
|
|
if [[ ! -d "${NDK_PATH}" ]]; then
|
|
echo "NDK directory is not in expected location: ${NDK_PATH}"
|
|
exit 1
|
|
fi
|
|
|
|
# Do not output ##vso[] commands with `set -x` or they may be parsed again and include a trailing quote.
|
|
set +x
|
|
|
|
set_var() {
|
|
local VAR_NAME=${1:?}
|
|
local VAR_VALUE=${2:?}
|
|
echo "##vso[task.setvariable variable=${VAR_NAME}]${VAR_VALUE}"
|
|
echo "${VAR_NAME}: ${VAR_VALUE}"
|
|
}
|
|
|
|
set_var "ANDROID_NDK_HOME" "${NDK_PATH}"
|
|
set_var "ANDROID_NDK_ROOT" "${NDK_PATH}"
|
|
|
|
displayName: Use Android NDK ${{ parameters.AndroidNdkVersion }}
|