From 5831db30891244ebdf9658e502080517a7d5030d Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Fri, 22 Feb 2019 13:35:52 -0800 Subject: [PATCH] Build quest demo apk on Jenkins --- android/apps/questInterface/build.gradle | 19 +++++++------ android/apps/questInterface/keystore.jks | Bin 0 -> 2223 bytes android/build_android.sh | 33 ++++++++++++++++++----- android/containerized_build.sh | 2 ++ 4 files changed, 38 insertions(+), 16 deletions(-) create mode 100644 android/apps/questInterface/keystore.jks diff --git a/android/apps/questInterface/build.gradle b/android/apps/questInterface/build.gradle index 3d13877607..bf600b5df1 100644 --- a/android/apps/questInterface/build.gradle +++ b/android/apps/questInterface/build.gradle @@ -44,10 +44,15 @@ android { } signingConfigs { release { - storeFile project.hasProperty("HIFI_ANDROID_KEYSTORE") ? file(HIFI_ANDROID_KEYSTORE) : null - storePassword project.hasProperty("HIFI_ANDROID_KEYSTORE_PASSWORD") ? HIFI_ANDROID_KEYSTORE_PASSWORD : '' - keyAlias project.hasProperty("HIFI_ANDROID_KEY_ALIAS") ? HIFI_ANDROID_KEY_ALIAS : '' - keyPassword project.hasProperty("HIFI_ANDROID_KEY_PASSWORD") ? HIFI_ANDROID_KEY_PASSWORD : '' + // Hack for Quest demo + storeFile file("keystore.jks") + storePassword "password" + keyAlias "key0" + keyPassword "password" + // storeFile project.hasProperty("HIFI_ANDROID_KEYSTORE") ? file(HIFI_ANDROID_KEYSTORE) : null + // storePassword project.hasProperty("HIFI_ANDROID_KEYSTORE_PASSWORD") ? HIFI_ANDROID_KEYSTORE_PASSWORD : '' + // keyAlias project.hasProperty("HIFI_ANDROID_KEY_ALIAS") ? HIFI_ANDROID_KEY_ALIAS : '' + // keyPassword project.hasProperty("HIFI_ANDROID_KEY_PASSWORD") ? HIFI_ANDROID_KEY_PASSWORD : '' v2SigningEnabled false } } @@ -133,12 +138,6 @@ android { assetList.each { file -> out.println(file) } } } - - variant.outputs.all { - if (RELEASE_NUMBER != '0') { - outputFileName = "app_" + RELEASE_NUMBER + "_" + RELEASE_TYPE + ".apk" - } - } } } diff --git a/android/apps/questInterface/keystore.jks b/android/apps/questInterface/keystore.jks new file mode 100644 index 0000000000000000000000000000000000000000..4b646122f6f20c60a69d27f15590bc69a757ef60 GIT binary patch literal 2223 zcmcgs={wX51O3fvX1rrx=GM4~5QE=bW0`ntS)(isLbC5-EMaVA(ny7CEs;T}s4SI2 zg|SDLNJ7XyGE|oA?o-eEKF|FN-Vf))Ip@nc=fm0O>~jDBfC2yj`3<3P=bXA`j(81FAhsS$ zAO5f&X%HvyB`iGj4 zwp#gCx-pp1C~MYb8jor+@}K(fqOz+(FEKiPyzx-2$z8qH zqHbD3rM+OPGOmC1O0m%KOxBp-dbsEAp5ORo$}*c$cKZgXxv-~aT!o*u5%*Vs-HdwU zW^#h@vSv*Y=de+XCtsBLVdL3YdheCo#+lu3yXwJnW8rPr@YKqv#!Df+u2*6?<%co~ z{SrGP@KZs&Yp2f>e0;N{dVM+@<@86K`v$P&JGgt3Zc)$7)lV90uYoNae;B5vLc_9$ zp5G~ZpfF{B9&jt_A^5K`vn`NZ)WCDLr$u}tYDMF6er$P^8dEVx?Wrw#7TQzN!3m`p zbf87ffQf>Dchzji;kkaR4K(%@jV6*!x{8RP^+-Aj3ncL8Pd}gP15)(Se)6$vPJSAC9mo!F%IGAkG>ld9d zIbuym8VlrW80aFhv8U!G^IZyBJ!!3BFW7x3G~SPRU$l70bkJXY*Dq6ZvO+jE8(;2? z*2OWXac@dgchXXm%24@D8QVy1N|l{Hdxg99RG3Lhy~3TMYAbxsa9wL{ez%L1?DqC4 z+Ff{mHK3Mf-V;hOmkW&H%N6bET1>yQw(xdq5-->6ec+h4sOG%Ys|Wl_}+^*VD$)aXn5q+T~o>mG9@H_Wmhd&p(1eT;KbWYuk*>1tN$q-W5g zVaF8fEN)NQMDz0${lMCs{QaaPe~IV7rfet+ehKc&=E03;@@a%cn`TX5=N!F--Om+m zbLcb2V&Bai{eeKLT62tsSH2ECI;a=$NFd!ssfX~g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sh index a066332f9a..106a295750 100755 --- a/android/build_android.sh +++ b/android/build_android.sh @@ -1,11 +1,32 @@ #!/usr/bin/env bash set -xeuo pipefail + +ANDROID_BUILD_TYPE=release +ANDROID_BUILD_TARGET=assembleRelease + +case "$RELEASE_TYPE" in + PR) ANDROID_APK_SUFFIX=PR${RELEASE_NUMBER}-${SHA7}.apk ;; + *) ANDROID_APK_SUFFIX=${RELEASE_NUMBER}-${SHA7}.apk ;; +esac + + +# Interface build +ANDROID_APP=interface +ANDROID_OUTPUT_DIR=./apps/${ANDROID_APP}/build/outputs/apk/${ANDROID_BUILD_TYPE} +ANDROID_OUTPUT_FILE=${ANDROID_APP}-${ANDROID_BUILD_TYPE}-unsigned.apk +ANDROID_APK_NAME=HighFidelity-Beta-${ANDROID_APK_SUFFIX} ./gradlew -PHIFI_ANDROID_PRECOMPILED=${HIFI_ANDROID_PRECOMPILED} -PVERSION_CODE=${VERSION_CODE} -PRELEASE_NUMBER=${RELEASE_NUMBER} -PRELEASE_TYPE=${RELEASE_TYPE} ${ANDROID_APP}:${ANDROID_BUILD_TARGET} +cp ${ANDROID_OUTPUT_DIR}/${ANDROID_OUTPUT_FILE} ./${ANDROID_APK_NAME} + +# Quest Interface build +ANDROID_APP=questInterface +ANDROID_OUTPUT_DIR=./apps/${ANDROID_APP}/build/outputs/apk/${ANDROID_BUILD_TYPE} +ANDROID_OUTPUT_FILE=${ANDROID_APP}-${ANDROID_BUILD_TYPE}.apk +ANDROID_APK_NAME=HighFidelity-Quest-Beta-${ANDROID_APK_SUFFIX} +./gradlew -PHIFI_ANDROID_PRECOMPILED=${HIFI_ANDROID_PRECOMPILED} -PVERSION_CODE=${VERSION_CODE} -PRELEASE_NUMBER=${RELEASE_NUMBER} -PRELEASE_TYPE=${RELEASE_TYPE} ${ANDROID_APP}:${ANDROID_BUILD_TARGET} +cp ${ANDROID_OUTPUT_DIR}/${ANDROID_OUTPUT_FILE} ./${ANDROID_APK_NAME} + + + -# This is the actual output from gradle, which no longer attempts to muck with the naming of the APK -OUTPUT_APK=./apps/${ANDROID_APP}/build/outputs/apk/${ANDROID_BUILD_DIR}/${ANDROID_BUILT_APK_NAME} -# This is the APK name requested by Jenkins -TARGET_APK=./${ANDROID_APK_NAME} -# Make sure this matches up with the new ARTIFACT_EXPRESSION for jenkins builds, which should be "android/*.apk" -cp ${OUTPUT_APK} ${TARGET_APK} diff --git a/android/containerized_build.sh b/android/containerized_build.sh index 8b2f26cb50..34e620ad2e 100755 --- a/android/containerized_build.sh +++ b/android/containerized_build.sh @@ -9,6 +9,7 @@ docker build --build-arg BUILD_UID=`id -u` -t "${DOCKER_IMAGE_NAME}" -f docker/D # So make sure we use VERSION_CODE consistently test -z "$VERSION_CODE" && export VERSION_CODE=$VERSION +# FIXME figure out which of these actually need to be forwarded and which can be eliminated docker run \ --rm \ --security-opt seccomp:unconfined \ @@ -27,6 +28,7 @@ docker run \ -e OAUTH_CLIENT_SECRET \ -e OAUTH_CLIENT_ID \ -e OAUTH_REDIRECT_URI \ + -e SHA7 \ -e VERSION_CODE \ "${DOCKER_IMAGE_NAME}" \ sh -c "./build_android.sh"