1 #! /bin/sh 2 3 # Copyright 2018 Google Inc. 4 # Use of this source code is governed by a BSD-style license that can be 5 # found in the LICENSE file. 6 7 set -e 8 9 ANDROID_NDK="$1" 10 11 if ! [ -d "$ANDROID_NDK" ] || ! [ -x "${ANDROID_NDK}/ndk-build" ]; then 12 printf "\nUsage:\n %s ANDROID_NDK_PATH\n" "$0" >&2 13 exit 1 14 fi 15 16 case ":${PATH}:" in 17 */depot_tools:*) ;; 18 *) 19 printf '\ndepot_tools should be in your $PATH.\n' >&2 20 exit 1;; 21 esac 22 23 if ! [ -d "$ANDROID_HOME" ] || ! [ -x "${ANDROID_HOME}/platform-tools/adb" ]; then 24 printf '\n$ANDROID_HOME not set or is broken.\n' >&2 25 exit 1 26 fi 27 28 set -x 29 30 ARCH=${SKQP_ARCH:-arm} 31 32 cd "$(dirname "$0")/../.." 33 34 BUILD=out/skqp-${ARCH} 35 36 python tools/skqp/generate_gn_args $BUILD "$ANDROID_NDK" $ARCH 37 38 GIT_SYNC_DEPS_QUIET=Y tools/git-sync-deps 39 40 bin/gn gen $BUILD 41 42 rm -rf $BUILD/gen 43 44 platform_tools/android/bin/android_build_app -C $BUILD skqp 45 46 set +x 47 48 printf '\n\nAPK built: "%s/skqp.apk"\n\n' "$(pwd)/$BUILD" 49 50