From 447f1e5fb4409dfca75e53e53d71904980f5e0a2 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 Change-Id: I87004c05f9a54d3b2f7854695349e8b506fa7e44 --- 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 + 6 files changed, 46 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3f2b4c29..67caed18 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,6 +3,15 @@ import groovy.xml.XmlUtil apply plugin: 'com.android.application' apply plugin: 'kotlin-android' +def gitDescribe = { -> + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'describe', '--always', '--tags', '--dirty=-dirty' + standardOutput = stdout + } + return stdout.toString().trim() +} + android { compileSdkVersion 29 @@ -11,6 +20,7 @@ android { defaultConfig { minSdkVersion 29 targetSdkVersion 29 + 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 f8b93c07..6738f02f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,8 +2,12 @@ + android:versionCode="29000001" + android:versionName="10-1.0.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