summaryrefslogtreecommitdiffstats
path: root/taskcluster/scripts/misc/wrench-android-build.sh
blob: 975ba8b85b32fb9266c3ccd1e70bdc7807f06e1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
set -x -e -v

MODE=${1?"First argument must be debug|release"}

pushd "${MOZ_FETCHES_DIR}"
mv wrench-deps/{vendor,.cargo,cargo-apk} ${GECKO_PATH}/gfx/wr
popd

pushd "${GECKO_PATH}/gfx/wr/wrench"
# These things come from the toolchain dependencies of the job that invokes
# this script (webrender-wrench-android-build).
export PATH="${PATH}:${MOZ_FETCHES_DIR}/rustc/bin"
export PATH="${PATH}:${JAVA_HOME}/bin"
export ANDROID_SDK_ROOT="${MOZ_FETCHES_DIR}/android-sdk-linux"
export ANDROID_NDK_ROOT="${MOZ_FETCHES_DIR}/android-ndk"

if [ "$MODE" == "debug" ]; then
    ../cargo-apk/bin/cargo-apk apk build --frozen --verbose --lib
elif [ "$MODE" == "release" ]; then
    ../cargo-apk/bin/cargo-apk apk build --frozen --verbose --lib --release
else
    echo "Unknown mode '${MODE}'; must be 'debug' or 'release'"
    exit 1
fi
popd