From 1994e9e22db5a022c80eca8e2cb5b32de44384da Mon Sep 17 00:00:00 2001 From: Laura Hermanns Date: Sun, 22 Sep 2024 16:41:48 -0400 Subject: [PATCH] [Android] Only generate Android app projects for either Debug or Release build. This fixes a bug in BuildAndroid.sh script that would always generate app projects for both Debug and Release builds when -d/--debug is *not* specified. --- BuildAndroid.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/BuildAndroid.sh b/BuildAndroid.sh index c262fe0fea..d35bbd52de 100644 --- a/BuildAndroid.sh +++ b/BuildAndroid.sh @@ -319,17 +319,14 @@ if [ $BUILD_APPS -ne 0 ]; then BIN_FILE_BASE="${OUTPUT_DIR}/${SUPPORTED_ANDROID_ABIS[0]}/build/libExample_" BIN_FILE_BASE_LEN=${#BIN_FILE_BASE} - - if [ $BUILD_TYPE = "Debug" ]; then - EXAMPLE_BIN_FILES=(${BIN_FILE_BASE}*D.so) - else - EXAMPLE_BIN_FILES=(${BIN_FILE_BASE}*.so) - fi + EXAMPLE_BIN_FILES=(${BIN_FILE_BASE}*.so) for BIN_FILE in ${EXAMPLE_BIN_FILES[@]}; do - BIN_FILE_LEN=${#BIN_FILE} - PROJECT_NAME=${BIN_FILE:BIN_FILE_BASE_LEN:BIN_FILE_LEN-BIN_FILE_BASE_LEN-3} - generate_app_project $PROJECT_NAME + if { [ $BUILD_TYPE = "Debug" ] && [[ $BIN_FILE == *D.so ]] } || { [ ! $BUILD_TYPE = "Debug" ] && ! [[ $BIN_FILE == *D.so ]] }; then + BIN_FILE_LEN=${#BIN_FILE} + PROJECT_NAME=${BIN_FILE:BIN_FILE_BASE_LEN:BIN_FILE_LEN-BIN_FILE_BASE_LEN-3} + generate_app_project $PROJECT_NAME + fi done fi