Last active
June 6, 2016 12:44
-
-
Save passsy/1b88fa99bc289796e1b19091530e9e11 to your computer and use it in GitHub Desktop.
lazy versionCode with git versioner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Optional: configure the versioner (before applying the script) | |
/* ext.gitVersioner = [ | |
defaultBranch : "develop", // default "master" | |
yearFactor : 1200, // default "1000", increasing every 8.57h | |
snapshotEnabled : false, // default false, the "-SNAPSHOT" postfix | |
localChangesCountEnabled: false // default false, the (<commitCount>) before -SNAPSHOT | |
] */ | |
apply from: 'https://raw.githubusercontent.com/passsy/gradle-GitVersioner/master/git-versioner.gradle' | |
android { | |
defaultConfig { | |
versionCode gitVersion.version // will change after every commit | |
versionName "1.0" // or the JakeWharton naming | |
// Don't use a dynamic version name. This will change the AndroidManifest.xml for | |
// every build and forces instantrun to reinstall the app instead of sending the | |
// diff to the device. Instant run will not work! | |
// use Buildconfig.REVISION instead. | |
// versionName gitVersionName | |
buildConfigField 'String', 'REVISION', "\"$gitVersionName\"" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment