Skip to content

Commit 0e80948

Browse files
committed
Fix versioning
1 parent f648a7f commit 0e80948

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ buildscript {
2525

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

3232
apply plugin: 'com.android.application'
3333

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

4343
int getMyVersionCode() {
@@ -65,7 +65,7 @@ android {
6565

6666
defaultConfig {
6767
versionName getMyVersionName()
68-
versionCode (getMyVersionCode() + 20000)
68+
versionCode(getMyVersionCode() + 20000)
6969
}
7070

7171
lintOptions {

0 commit comments

Comments
 (0)