2018-12-04 18:16:01 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Copyright 2018 Google LLC.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
2018-12-07 16:18:51 +00:00
|
|
|
# Notes:
|
|
|
|
#
|
|
|
|
# You may need to run as root for docker permissions.
|
|
|
|
#
|
|
|
|
# You *must* run `tools/git-sync-deps` first.
|
2018-12-04 18:16:01 +00:00
|
|
|
|
2019-08-07 20:31:51 +00:00
|
|
|
if [ "$SKQP_OUTPUT_DIR" ]; then
|
|
|
|
mkdir -p "$SKQP_OUTPUT_DIR" || exit 1
|
|
|
|
OUT="$(cd "$SKQP_OUTPUT_DIR"; pwd)"
|
|
|
|
else
|
|
|
|
OUT="$(mktemp -d "${TMPDIR:-/tmp}/skqp_apk.XXXXXXXXXX")"
|
|
|
|
fi
|
2018-12-04 18:16:01 +00:00
|
|
|
SKIA_ROOT="$(cd "$(dirname "$0")/../.."; pwd)"
|
|
|
|
|
|
|
|
cd "${SKIA_ROOT}/infra/skqp/docker"
|
|
|
|
|
|
|
|
docker build -t android-skqp ./android-skqp/
|
2018-12-18 16:01:25 +00:00
|
|
|
|
2019-08-07 20:31:51 +00:00
|
|
|
NAME=$(date +android_em_%Y%m%d_%H%M%S)
|
|
|
|
|
|
|
|
docker run --rm -d --name "$NAME" \
|
2018-12-04 18:16:01 +00:00
|
|
|
--env=DEVICE="Samsung Galaxy S6" \
|
2018-12-04 19:17:13 +00:00
|
|
|
--volume="$SKIA_ROOT":/SRC \
|
2018-12-04 18:16:01 +00:00
|
|
|
--volume="$OUT":/OUT \
|
|
|
|
android-skqp
|
2018-12-18 16:01:25 +00:00
|
|
|
|
2019-08-07 20:31:51 +00:00
|
|
|
BUILD="$(docker exec "$NAME" mktemp -d)"
|
|
|
|
|
2018-12-04 18:16:01 +00:00
|
|
|
docker exec \
|
|
|
|
--env=SKQP_OUTPUT_DIR=/OUT \
|
2019-08-07 20:31:51 +00:00
|
|
|
--env=SKQP_BUILD_DIR="$BUILD" \
|
|
|
|
"$NAME" /SRC/tools/skqp/make_universal_apk.py
|
2018-12-18 16:01:25 +00:00
|
|
|
|
2018-12-18 13:59:06 +00:00
|
|
|
if [ -f "$OUT"/skqp-universal-debug.apk ]; then
|
2019-08-07 20:31:51 +00:00
|
|
|
docker exec "$NAME" find /OUT -type f -exec chmod 0666 '{}' '+'
|
2018-12-18 13:59:06 +00:00
|
|
|
fi
|
|
|
|
|
2019-08-07 20:31:51 +00:00
|
|
|
docker kill "$NAME"
|
2018-12-18 16:01:25 +00:00
|
|
|
|
2018-12-18 13:59:06 +00:00
|
|
|
ls -l "$OUT"/*.apk 2> /dev/null
|