buildscripts: fix Android apk/dex comparison (#4511)

This commit is contained in:
Eric Gribkoff 2018-05-25 15:07:17 -07:00 committed by GitHub
parent 608ce3d344
commit f3ef2850a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ cd ../routeguide
cd ../helloworld
./gradlew build
cd $BASE_DIR/github/grpc-java/examples/example-kotlin/android/helloworld/
cd "$BASE_DIR/github/grpc-java/examples/example-kotlin/android/helloworld/"
./gradlew build
# Skip APK size and dex count comparisons for non-PR builds
@ -54,7 +54,6 @@ if [[ -z "${KOKORO_GITHUB_PULL_REQUEST_COMMIT:-}" ]]; then
exit 0
fi
# Save a copy of set_github_status.py (it may differ from the base commit)
SET_GITHUB_STATUS="$TMPDIR/set_github_status.py"
@ -64,7 +63,8 @@ cp "$BASE_DIR/github/grpc-java/buildscripts/set_github_status.py" "$SET_GITHUB_S
# Collect APK size and dex count stats for the helloworld example
read -r ignored new_dex_count < \
<("${ANDROID_HOME}/tools/bin/apkanalyzer" dex references app/build/outputs/apk/release/app-release-unsigned.apk)
<("${ANDROID_HOME}/tools/bin/apkanalyzer" dex references \
"$BASE_DIR/github/grpc-java/examples/android/helloworld/app/build/outputs/apk/release/app-release-unsigned.apk")
set +x
all_new_methods=`"${ANDROID_HOME}/tools/bin/apkanalyzer" dex packages --proguard-mapping app/build/outputs/mapping/release/mapping.txt app/build/outputs/apk/release/app-release-unsigned.apk | grep ^M | cut -f4 | sort`