added build.sh argument for clean/debug mode

This commit is contained in:
2025-12-10 10:38:43 +01:00
parent 339044336f
commit 5cdff335c7
2 changed files with 10 additions and 1 deletions

View File

@@ -2,6 +2,14 @@
# This script will initialize the gradle build process for all subprojects in src dicetory
# Check for a build mode argument
if [ "$1" == "clean" ]; then
BUILD_MODE="assembleClean"
else
BUILD_MODE="assembleDebug"
fi
# check if user is root and change user to builder
if [ "$EUID" -eq 0 ]; then
@@ -19,7 +27,7 @@ yes | /opt/android-sdk/cmdline-tools/latest/bin/sdkmanager --licenses
for dir in src/*/; do
if [ -f "$dir/build.gradle" ]; then
echo "Building project in $dir"
(cd "$dir" && gradle assembleDebug)
(cd "$dir" && gradle clean $BUILD_MODE)
else
echo "No build.gradle found in $dir, skipping."
fi