Skip to content

Commit

Permalink
[Android] Only generate Android app projects for either Debug or Rele…
Browse files Browse the repository at this point in the history
…ase 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.
  • Loading branch information
LukasBanana committed Sep 22, 2024
1 parent c66d632 commit 1994e9e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions BuildAndroid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1994e9e

Please sign in to comment.