Add git branch name to debug app's version name
This commit is contained in:
parent
77290b4ad3
commit
7d92ecc56d
1 changed files with 10 additions and 1 deletions
|
|
@ -19,6 +19,15 @@ repositories {
|
|||
maven { url 'https://maven.fabric.io/public' }
|
||||
}
|
||||
|
||||
def gitBranch() {
|
||||
def branch = ''
|
||||
def proc = 'git rev-parse --abbrev-ref HEAD'.execute()
|
||||
proc.in.eachLine { line -> branch = line }
|
||||
proc.err.eachLine { line -> println line }
|
||||
proc.waitFor()
|
||||
branch
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion '25.0.3'
|
||||
|
|
@ -44,7 +53,7 @@ android {
|
|||
}
|
||||
debug {
|
||||
applicationIdSuffix '.debug'
|
||||
versionNameSuffix ' DEBUG'
|
||||
versionNameSuffix ' DEBUG (' + gitBranch() + ')'
|
||||
|
||||
ext.enableCrashlytics = false // Disable fabric build ID generation for debug builds
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue