From 18f311512aec7b828c87c3b297135482abd389a2 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Tue, 21 Jul 2020 14:58:44 -0300 Subject: [wallet] introduce build flavors for distribution channels (google play, fdroid, nightly) and show flavor name in dev settings --- wallet/build.gradle | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'wallet/build.gradle') diff --git a/wallet/build.gradle b/wallet/build.gradle index d93b8b9..5b28c6c 100644 --- a/wallet/build.gradle +++ b/wallet/build.gradle @@ -25,6 +25,18 @@ plugins { def walletCoreVersion = "v0.7.1-dev.10" +static def versionCodeEpoch() { + return (new Date().getTime() / 1000).toInteger() +} +def gitCommit = { -> + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'rev-parse', '--short=7', 'HEAD' + standardOutput = stdout + } + return stdout.toString().trim() +} + android { compileSdkVersion 29 //noinspection GradleDependency @@ -45,6 +57,22 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } + flavorDimensions "distributionChannel" + productFlavors { + fdroid { + dimension "distributionChannel" + applicationIdSuffix ".fdroid" + } + google { + dimension "distributionChannel" + } + nightly { + dimension "distributionChannel" + applicationIdSuffix ".nightly" + versionCode versionCodeEpoch() + versionNameSuffix " ($gitCommit)" + } + } compileOptions { sourceCompatibility = 1.8 -- cgit v1.2.3