added build.sh argument for clean/debug mode
This commit is contained in:
10
build.sh
10
build.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user