From 7694eb3cf9052732878715eb1acc89957bf8da35 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Fri, 23 Oct 2020 10:25:44 -0300 Subject: [PATCH] Move to different versioning scheme and show version in About dialog --- app/build.gradle | 10 ++++++++++ app/src/main/AndroidManifest.xml | 8 ++++++-- .../seedvault/settings/AboutDialogFragment.kt | 9 +++++++++ .../seedvault/transport/backup/PackageService.kt | 6 ++++++ app/src/main/res/layout/fragment_about.xml | 15 ++++++++++++++- app/src/main/res/values/strings.xml | 1 + contactsbackup/build.gradle | 6 ++---- contactsbackup/src/main/AndroidManifest.xml | 8 +++++++- 8 files changed, 55 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f7418a95..7edfffed 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,6 +6,15 @@ plugins { id "org.jlleitschuh.gradle.ktlint" version "9.4.0" } +def gitDescribe = { -> + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'describe', '--always', '--tags', '--dirty=-dirty' + standardOutput = stdout + } + return stdout.toString().trim() +} + android { compileSdkVersion 30 @@ -14,6 +23,7 @@ android { defaultConfig { minSdkVersion 29 // leave at 29 for robolectric tests targetSdkVersion 30 + versionNameSuffix "-$gitDescribe" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunnerArguments disableAnalytics: 'true' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 71c760ca..143ce520 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,8 +2,12 @@ + android:versionCode="30000001" + android:versionName="11-1.0"> + ) { packages.chunked(LOG_MAX_PACKAGES).forEach { Log.i(TAG, it.toString()) diff --git a/app/src/main/res/layout/fragment_about.xml b/app/src/main/res/layout/fragment_about.xml index d391f61c..061b9e75 100644 --- a/app/src/main/res/layout/fragment_about.xml +++ b/app/src/main/res/layout/fragment_about.xml @@ -62,6 +62,19 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/appNameView" /> + + + app:layout_constraintTop_toBottomOf="@+id/versionView" /> About A backup application using Android\'s internal backup API. + Version: %s License: Apache2 Written by: Steve Soltys and Torsten Grote Design by: Glenn Sorrentino diff --git a/contactsbackup/build.gradle b/contactsbackup/build.gradle index eb622f90..9fcec7c5 100644 --- a/contactsbackup/build.gradle +++ b/contactsbackup/build.gradle @@ -9,8 +9,6 @@ android { applicationId "org.calyxos.backup.contacts" minSdkVersion 30 targetSdkVersion 30 - versionCode 30 - versionName "0.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -54,8 +52,8 @@ dependencies { //noinspection GradleDependency testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - testImplementation 'junit:junit:4.13' - def mockk_version = "1.10.0" + testImplementation 'junit:junit:4.13.1' + def mockk_version = "1.10.2" testImplementation "io.mockk:mockk:$mockk_version" //noinspection GradleDependency diff --git a/contactsbackup/src/main/AndroidManifest.xml b/contactsbackup/src/main/AndroidManifest.xml index 43fa2699..f06c99bc 100644 --- a/contactsbackup/src/main/AndroidManifest.xml +++ b/contactsbackup/src/main/AndroidManifest.xml @@ -1,7 +1,13 @@ + package="org.calyxos.backup.contacts" + android:versionCode="30000001" + android:versionName="11-0.1"> +