diff --git a/.idea/misc.xml b/.idea/misc.xml index 37a750962..7bfef59df 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + diff --git a/build.gradle b/build.gradle index bc45106e7..b35b9f557 100644 --- a/build.gradle +++ b/build.gradle @@ -17,11 +17,43 @@ allprojects { } } +def getVersionCode = { -> + try { + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'rev-list', 'HEAD', '--count' + standardOutput = stdout + } + return Integer.parseInt(stdout.toString().trim()) + } + catch (ignored) { + return -1; + } +} + +def getVersionName = { -> + try { + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'describe', '--tags', '--dirty' + standardOutput = stdout + } + return stdout.toString().trim() + } + catch (ignored) { + return null; + } +} + android { compileSdkVersion 28 defaultConfig { applicationId "de.dennisguse.opentracks" + //Useful for debugging. + //versionCode getVersionCode() + //versionName getVersionName() + minSdkVersion 21 targetSdkVersion 28 @@ -29,10 +61,19 @@ android { } buildTypes { + debug { + applicationIdSuffix ".debug" + versionNameSuffix "-debug" + } + release { minifyEnabled true } } + + applicationVariants.all { variant -> + variant.resValue "string", "applicationId", variant.applicationId + } } dependencies { @@ -43,3 +84,4 @@ dependencies { androidTestImplementation 'androidx.test.ext:junit:1.1.1' testImplementation 'androidx.test:core:1.2.0' } + diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 96d1fcc33..e9716ee80 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -17,8 +17,8 @@ limitations under the License. xmlns:tools="http://schemas.android.com/tools" package="de.dennisguse.opentracks" android:installLocation="auto" - android:versionCode="100" - android:versionName="3.0.0"> + android:versionCode="2916" + android:versionName="v3.0.0"> @@ -186,18 +186,18 @@ limitations under the License. + + Project web page: %1$s - - Version: %1$s + + Version name: %1$s + + + Version code: %1$d OpenTracks is a fork of Google\'s MyTracks (discontinued in 2016). diff --git a/src/main/res/xml/settings.xml b/src/main/res/xml/settings.xml index cdc57c350..25410550c 100644 --- a/src/main/res/xml/settings.xml +++ b/src/main/res/xml/settings.xml @@ -38,7 +38,7 @@ limitations under the License. \ No newline at end of file