Skip to content

Commit

Permalink
Fix versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
mar-v-in committed Apr 6, 2016
1 parent f648a7f commit 0e80948
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ buildscript {

/* This is a hack, trying to provide release updates to F-Droid until it can properly handle Gradle
applicationId "org.microg.nlp.backend.apple"
versionName "1.2.1"
versionCode "20037"
versionName "1.2.2"
versionCode "20038"
*/

apply plugin: 'com.android.application'

String getMyVersionName() {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--always', '--dirty'
standardOutput = stdout
}
return stdout.toString().trim()
if (rootProject.file("gradlew").exists())
exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout }
else // automatic build system, don't tag dirty
exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout }
return stdout.toString().trim().substring(1)
}

int getMyVersionCode() {
Expand Down Expand Up @@ -65,7 +65,7 @@ android {

defaultConfig {
versionName getMyVersionName()
versionCode (getMyVersionCode() + 20000)
versionCode(getMyVersionCode() + 20000)
}

lintOptions {
Expand Down

0 comments on commit 0e80948

Please sign in to comment.