Skip to content

Commit 5f12cc3

Browse files
committed
Conditionally build AAB+APK vs separate APK and AAB
1 parent e7f1127 commit 5f12cc3

File tree

1 file changed

+11
-3
lines changed
  • application/console/views/cron/scripts/upload/default

1 file changed

+11
-3
lines changed

application/console/views/cron/scripts/upload/default/build.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,19 @@ build_apk() {
146146

147147
cd "$PROJECT_DIR" || exit 1
148148

149-
# shellcheck disable=SC2086
150-
$APP_BUILDER_SCRIPT_PATH -load build.appDef -no-save -build ${KS_OPT} -fp apk.output="$OUTPUT_DIR" -vc "$VERSION_CODE" -vn "$VERSION_NAME" ${SCRIPT_OPT}
151-
if [[ "${BUILD_ANDROID_AAB}" == "1" ]]; then
149+
echo "APPBUILDER_SCRIPT_VERSION=${APPBUILDER_SCRIPT_VERSION}"
150+
# If AppBuilder >= 13.3, building AAB will also build APK, so no need for a separate APK build
151+
if [[ "${BUILD_ANDROID_AAB}" == "1" ]] && dpkg --compare-versions "$APPBUILDER_SCRIPT_VERSION" ge "13.3"; then
152152
# shellcheck disable=SC2086
153153
$APP_BUILDER_SCRIPT_PATH -load build.appDef -no-save -build -app-bundle ${KS_OPT} -fp apk.output="$OUTPUT_DIR" -vc "$VERSION_CODE" -vn "$VERSION_NAME" ${SCRIPT_OPT}
154+
else
155+
# If AppBuilder < 13.3, regular APK build and possible AAB build
156+
# shellcheck disable=SC2086
157+
$APP_BUILDER_SCRIPT_PATH -load build.appDef -no-save -build ${KS_OPT} -fp apk.output="$OUTPUT_DIR" -vc "$VERSION_CODE" -vn "$VERSION_NAME" ${SCRIPT_OPT}
158+
if [[ "${BUILD_ANDROID_AAB}" == "1" ]]; then
159+
# shellcheck disable=SC2086
160+
$APP_BUILDER_SCRIPT_PATH -load build.appDef -no-save -build -app-bundle ${KS_OPT} -fp apk.output="$OUTPUT_DIR" -vc "$VERSION_CODE" -vn "$VERSION_NAME" ${SCRIPT_OPT}
161+
fi
154162
fi
155163

156164
# verify output -- AAPT2 is failing during appbuilder build but error is not getting back to script

0 commit comments

Comments
 (0)