skia2/tools/skqp/make_apk.sh
Hal Canary 181ec2f02f SkQP: Stop requiring users to use posix shell
Also update README.md

Change-Id: I62f5ac38ff4a8c3aa19d895441a76664cb8e8176
Reviewed-on: https://skia-review.googlesource.com/99302
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-01-24 21:11:19 +00:00

50 lines
961 B
Bash
Executable File

#! /bin/sh
# Copyright 2018 Google Inc.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e
ANDROID_NDK="$1"
if ! [ -d "$ANDROID_NDK" ] || ! [ -x "${ANDROID_NDK}/ndk-build" ]; then
printf "\nUsage:\n %s ANDROID_NDK_PATH\n" "$0" >&2
exit 1
fi
case ":${PATH}:" in
*/depot_tools:*) ;;
*)
printf '\ndepot_tools should be in your $PATH.\n' >&2
exit 1;;
esac
if ! [ -d "$ANDROID_HOME" ] || ! [ -x "${ANDROID_HOME}/platform-tools/adb" ]; then
printf '\n$ANDROID_HOME not set or is broken.\n' >&2
exit 1
fi
set -x
ARCH=${SKQP_ARCH:-arm}
cd "$(dirname "$0")/../.."
BUILD=out/skqp-${ARCH}
python tools/skqp/generate_gn_args $BUILD "$ANDROID_NDK" $ARCH
GIT_SYNC_DEPS_QUIET=Y tools/git-sync-deps
bin/gn gen $BUILD
rm -rf $BUILD/gen
platform_tools/android/bin/android_build_app -C $BUILD skqp
set +x
printf '\n\nAPK built: "%s/skqp.apk"\n\n' "$(pwd)/$BUILD"