gradle-gitVersioner-plugin
gradle-gitVersioner-plugin copied to clipboard
GitVersioner conflicts with Instant Run
GitVersioner includes the number of changes in the versionName
, so with (almost) every build the versionName
changes to something like
android:versionName = 500-feature/my_awesome_feature-SNAPSHOT(2 +3 -5)
This forces Instant Run to always do cold swaps, restarting the whole app for small changes like adding layout attributes, because the AndroidManifest
has changed.
It would be desirable that the versionName
for Instant Run builds doesn't change or there is an option to disable the suffix including the amount of changes in the versionName
.
You should not use dynamic version names and code when you develop. You could add a beta build, which you can send to your testers.
buildTypes
{
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
defaultConfig.versionCode gitVersioner.versionCode
defaultConfig.versionName gitVersioner.versionName
}
debug {
applicationIdSuffix ".debug"
debuggable true
}
beta {
initWith debug
//manifestPlaceholders = [hostName:"internal.example.com"]
applicationIdSuffix ".beta"
matchingFallbacks = ['debug', 'release']
defaultConfig.versionCode gitVersioner.versionCode
defaultConfig.versionName "BETA_" + gitVersioner.versionName
}
}