make_apk.sh 961 B

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