Last active
September 22, 2017 14:09
-
-
Save passsy/af4fcf46ef58dd0ed33e46b2a4e69d0b to your computer and use it in GitHub Desktop.
include git-versioner into your project
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
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:2.1.0' | |
// NOTE: Do not place your application dependencies here; they belong | |
// in the individual module build.gradle files | |
} | |
} | |
// Optional: configure the versioner | |
/*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 | |
]*/ | |
// import the script which runs the version generation | |
apply from: 'https://raw.githubusercontent.com/passsy/gradle-GitVersioner/master/git-versioner.gradle' |
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
android { | |
defaultConfig { | |
... | |
buildConfigField 'String', 'REVISION', "\"$gitVersionName\"" | |
} | |
productFlavors { | |
... | |
beta { | |
applicationIdSuffix '.beta' | |
versionCode gitVersion.version | |
versionName gitVersionName | |
} | |
playStore { | |
versionCode 21 | |
versionName '3.0.1' | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment