Skip to content
Snippets Groups Projects
Commit cb9fe03b authored by Volker Richert's avatar Volker Richert
Browse files

branch name can be added to VERSION_NAME

parent 88b21396
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ apply plugin: 'realm-android'
def gitVersion() {
// current dir is <your proj>/app, so it's likely that all your git repo files are in the dir
// above.
ext.repo = Grgit.open(project.file('..'))
ext.repo = Grgit.open()
// should result in the same value as running
// git tag -l | wc -l or git tag -l | grep -c ".*" -
......@@ -36,14 +36,15 @@ def gitVersion() {
}
def gitCommitId() {
//def process = ['sh', '-c', 'git tag -l | grep -c ".*" -'].execute().text.trim()
//return process.toInteger() + 1
//return 42
// current dir is <your proj>/app, so it's likely that all your git repo files are in the dir
// above.
ext.repo = Grgit.open(project.file('..'))
ext.repo = Grgit.open()
return ext.repo.log().first().id.substring(0, 7) //+ " " + ext.repo.branch.current.name
}
return ext.repo.log().first().id.substring(0, 7)
def gitBranch() {
ext.repo = Grgit.open()
return ext.repo.branch.current.name
}
def getBugfenderApiKey() {
......@@ -66,7 +67,7 @@ android {
applicationId "info.nightscout.android"
minSdkVersion 14
targetSdkVersion 23
versionName project.properties['version'] + "/" + gitCommitId()
versionName project.properties['version'] + "/" + gitCommitId() // + " (" + gitBranch()+")"
versionCode gitVersion()
buildConfigField "String", "BUGFENDER_API_KEY", getBugfenderApiKey()
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment