From b2280e9d8fe4f0de1242600f56c3e0851f44317a Mon Sep 17 00:00:00 2001 From: cyberta Date: Fri, 29 Nov 2019 15:18:58 +0100 Subject: check if split apk related build tasks exist --- prepareForDistribution.sh | 55 +++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/prepareForDistribution.sh b/prepareForDistribution.sh index 4b60a6c2..047fcfae 100755 --- a/prepareForDistribution.sh +++ b/prepareForDistribution.sh @@ -243,34 +243,53 @@ then fi fi - ./cleanProject.sh || quit - ./build_deps.sh || quit + #./cleanProject.sh || quit + #./build_deps.sh || quit mkdir $PREPARE_FOR_DISTRIBUTION_FILE_DIR if [[ ${BETA} == true ]] then ./gradlew clean assemble${FLAVOR}ProductionFatBeta --stacktrace || quit cp $BASE_FILE_DIR/${FLAVOR}ProductionFat/beta/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR - ./gradlew clean assemble${FLAVOR}ProductionX86Beta --stacktrace || quit - cp $BASE_FILE_DIR/${FLAVOR}ProductionX86/beta/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR - ./gradlew clean assemble${FLAVOR}ProductionX86_64Beta --stacktrace || quit - cp $BASE_FILE_DIR/${FLAVOR}ProductionX86_64/beta/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR - ./gradlew clean assemble${FLAVOR}ProductionArmv7Beta --stacktrace || quit - cp $BASE_FILE_DIR/${FLAVOR}ProductionArmv7/beta/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR - ./gradlew clean assemble${FLAVOR}ProductionArm64Beta --stacktrace || quit - cp $BASE_FILE_DIR/${FLAVOR}ProductionArmv64/beta/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR + # custom builds might have disabled split apks -> check if build task exist + if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductionX86Beta) ]]; then + ./gradlew clean assemble${FLAVOR}ProductionX86Beta --stacktrace || quit + cp $BASE_FILE_DIR/${FLAVOR}ProductionX86/beta/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR + fi + if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductionX86_64Beta) ]]; then + ./gradlew clean assemble${FLAVOR}ProductionX86_64Beta --stacktrace || quit + cp $BASE_FILE_DIR/${FLAVOR}ProductionX86_64/beta/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR + fi + if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductionArmv7Beta) ]]; then + ./gradlew clean assemble${FLAVOR}ProductionArmv7Beta --stacktrace || quit + cp $BASE_FILE_DIR/${FLAVOR}ProductionArmv7/beta/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR + fi + if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductionArmv7Beta) ]]; then + ./gradlew clean assemble${FLAVOR}ProductionArm64Beta --stacktrace || quit + cp $BASE_FILE_DIR/${FLAVOR}ProductionArmv64/beta/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR + fi else ./gradlew clean assemble${FLAVOR}ProductionFatRelease --stacktrace || quit cp $BASE_FILE_DIR/${FLAVOR}ProductionFat/release/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR - ./gradlew clean assemble${FLAVOR}ProductionX86Release --stacktrace || quit - cp $BASE_FILE_DIR/${FLAVOR}ProductionX86/release/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR - ./gradlew clean assemble${FLAVOR}ProductionX86_64Release --stacktrace || quit - cp $BASE_FILE_DIR/${FLAVOR}ProductionX86_64/release/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR - ./gradlew clean assemble${FLAVOR}ProductionArmv7Release --stacktrace || quit - cp $BASE_FILE_DIR/${FLAVOR}ProductionArmv7/release/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR - ./gradlew clean assemble${FLAVOR}ProductionArm64Release --stacktrace || quit - cp $BASE_FILE_DIR/${FLAVOR}ProductionArmv64/beta/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR + + # custom builds might have disabled split apks -> check if build task exist + if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductionX86Release) ]]; then + ./gradlew clean assemble${FLAVOR}ProductionX86Release --stacktrace || quit + cp $BASE_FILE_DIR/${FLAVOR}ProductionX86/release/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR + fi + if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductionX86_64Release) ]]; then + ./gradlew clean assemble${FLAVOR}ProductionX86_64Release --stacktrace || quit + cp $BASE_FILE_DIR/${FLAVOR}ProductionX86_64/release/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR + fi + if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductioArmv7Release) ]]; then + ./gradlew clean assemble${FLAVOR}ProductionArmv7Release --stacktrace || quit + cp $BASE_FILE_DIR/${FLAVOR}ProductionArmv7/release/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR + fi + if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductionArm64Release) ]]; then + ./gradlew clean assemble${FLAVOR}ProductionArm64Release --stacktrace || quit + cp $BASE_FILE_DIR/${FLAVOR}ProductionArmv64/beta/*.apk $PREPARE_FOR_DISTRIBUTION_FILE_DIR + fi fi fi -- cgit v1.2.3