Currently I'm trying to improve our buildscript with auto incrementing the versioncode so our QA team has got a clue what build they are testing and can log against a specific versioncode. We have got 3 productFlavors (staging, qa, production) and 2 signing configs (debug, release).
I looked into different solutions:
How to autoincrement versionCode in Android Gradle
How to autoincrement versionCode in Android Gradle
Autoincrement VersionCode with gradle extra properties
Based on those answers I've built a versioncode incrementor using a version.properties file.
Now the problem arises that for EVERY productFlavor and SigningConfig combination (+ the gradle sync in android studio) a new versioncode is generated. I want the versioncode to increment whenever I hit the play button to create a qaRelease build. So our buildcycle would be:
- development (never change the versioncode)
- qual (Update the versioncode)
- production (never change the versioncode)