Hal Canary | 4080305 | 2018-01-22 16:51:55 -0500 | [diff] [blame] | 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 | |
Hal Canary | 23fda7a | 2018-01-23 09:22:38 +0000 | [diff] [blame] | 34 | BUILD=out/skqp-${ARCH} |
Hal Canary | 4080305 | 2018-01-22 16:51:55 -0500 | [diff] [blame] | 35 | |
Hal Canary | 181ec2f | 2018-01-24 13:42:38 -0500 | [diff] [blame] | 36 | python tools/skqp/generate_gn_args $BUILD "$ANDROID_NDK" $ARCH |
Hal Canary | 4080305 | 2018-01-22 16:51:55 -0500 | [diff] [blame] | 37 | |
| 38 | GIT_SYNC_DEPS_QUIET=Y tools/git-sync-deps |
| 39 | |
Hal Canary | 23fda7a | 2018-01-23 09:22:38 +0000 | [diff] [blame] | 40 | bin/gn gen $BUILD |
Hal Canary | 4080305 | 2018-01-22 16:51:55 -0500 | [diff] [blame] | 41 | |
Hal Canary | 23fda7a | 2018-01-23 09:22:38 +0000 | [diff] [blame] | 42 | rm -rf $BUILD/gen |
Hal Canary | 4080305 | 2018-01-22 16:51:55 -0500 | [diff] [blame] | 43 | |
Hal Canary | 23fda7a | 2018-01-23 09:22:38 +0000 | [diff] [blame] | 44 | platform_tools/android/bin/android_build_app -C $BUILD skqp |
Hal Canary | 4080305 | 2018-01-22 16:51:55 -0500 | [diff] [blame] | 45 | |
| 46 | set +x |
| 47 | |
Hal Canary | 23fda7a | 2018-01-23 09:22:38 +0000 | [diff] [blame] | 48 | printf '\n\nAPK built: "%s/skqp.apk"\n\n' "$(pwd)/$BUILD" |
Hal Canary | 4080305 | 2018-01-22 16:51:55 -0500 | [diff] [blame] | 49 | |