android-common
Shared build versioning and release signing for the Android projects in this folder.
| File | Purpose | Commit? |
|---|---|---|
android-common.gradle | Master copy of the shared build script | yes |
sync.cmd | Copies the master into every project's gradle/ | yes |
In each project
version.properties(committed):major,minor,patch. versionCode = major·10000 + minor·100 + patch.gradle/android-common.gradle(committed copy, so clones build without this folder).app/build.gradle.kts:apply(from = rootProject.file("gradle/android-common.gradle"))
Tasks
gradlew bumpPatch | bumpMinor | bumpMajor
gradlew printVersion # version + which key release uses
gradlew assembleRelease # -> app/build/outputs/apk/release/<Project>-<version>-release.apk
gradlew syncAndroidCommon # update this project's copy from the master
Release key lookup (first hit wins)
<project>/keystore.properties(storeFile,storePassword,keyAlias,keyPassword;storeFilerelative to the project root) — per-project override.RELEASE_STORE_FILE,RELEASE_STORE_PASSWORD,RELEASE_KEY_ALIAS,RELEASE_KEY_PASSWORDfrom environment variables,-Poptions or%USERPROFILE%\.gradle\gradle.properties(the normal place: one key for all projects, outside every repo). Surrounding quotes are ignored.
No key → release is signed with the debug key and a warning is printed.
-Pandroid.common.unsigned=true → unsigned release.
Adding a new project
- Copy
android-common.gradleto<project>/gradle/. - Create
<project>/version.properties. - In
app/build.gradle.ktsadd theapply(from = ...)line right afterplugins { }and removeversionCode,versionNameand anysigningConfiglines.