Auto-commit after successful build: improve build setup

Changed files:\nSetupBuildEnvironment.sh
app/build.gradle.kts
This commit is contained in:
Joe Tretter
2026-04-24 16:29:42 -05:00
parent 5b5d88872f
commit 499bfe503a
2 changed files with 16 additions and 2 deletions

View File

@@ -280,15 +280,21 @@ maybe_build() {
local mode="${1:-}"
local gradle_task=""
local artifact_label=""
local artifact_source=""
local artifact_target=""
case "$mode" in
--build)
gradle_task="assembleDebug"
artifact_label="debug APK"
artifact_source="$PROJECT_DIR/app/build/outputs/apk/debug/app-debug.apk"
artifact_target="$PROJECT_DIR/app/build/outputs/apk/debug/githug-android-debug.apk"
;;
--build-aab)
gradle_task="bundleDebug"
artifact_label="debug AAB"
artifact_source="$PROJECT_DIR/app/build/outputs/bundle/debug/app-debug.aab"
artifact_target="$PROJECT_DIR/app/build/outputs/bundle/debug/githug-android-debug.aab"
;;
*)
return
@@ -299,6 +305,14 @@ maybe_build() {
bump_android_version
log "Building $artifact_label with --no-daemon"
"$PROJECT_DIR/gradlew" --no-daemon "$gradle_task"
if [ -f "$artifact_source" ]; then
log "Renaming $(basename "$artifact_source") to $(basename "$artifact_target")"
mv -f "$artifact_source" "$artifact_target"
else
log "Expected build output not found for rename: ${artifact_source#$PROJECT_DIR/}"
fi
auto_commit_if_needed
log "Stopping any Gradle daemons just in case"
"$PROJECT_DIR/gradlew" --stop >/dev/null 2>&1 || true

View File

@@ -11,8 +11,8 @@ android {
applicationId = "solutions.tretter.githugandroid"
minSdk = 26
targetSdk = 34
versionCode = 81
versionName = "0.1.80"
versionCode = 82
versionName = "0.1.81"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true