diff --git a/README.md b/README.md index f12649e..fbad945 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,11 @@ bash ./SetupBuildEnvironment.sh --build the script will also attempt to create a **git commit after a successful build** if there are source changes to commit. +It will also automatically bump the Android app version in `app/build.gradle.kts` before each build by: + +- incrementing `versionCode` by 1 +- incrementing the patch component of `versionName` (for example `0.1.0` → `0.1.1`) + ## Next steps toward full GitHug parity - Expand the Git sandbox to cover merge, rebase, stash, tags, remotes, reset, revert, cherry-pick, bisect, and more diff --git a/SetupBuildEnvironment.sh b/SetupBuildEnvironment.sh index d91afb0..ba98be7 100755 --- a/SetupBuildEnvironment.sh +++ b/SetupBuildEnvironment.sh @@ -195,6 +195,41 @@ sdk.dir=$SDK_DIR EOF_INNER } +bump_android_version() { + local gradle_file="$PROJECT_DIR/app/build.gradle.kts" + if [ ! -f "$gradle_file" ]; then + log "No app/build.gradle.kts found; skipping version bump" + return + fi + + log "Bumping Android app version before build" + python - <