diff options
author | Torsten Grote <t@grobox.de> | 2020-07-21 14:58:44 -0300 |
---|---|---|
committer | Torsten Grote <t@grobox.de> | 2020-07-21 15:06:54 -0300 |
commit | 18f311512aec7b828c87c3b297135482abd389a2 (patch) | |
tree | 7f355da971ba91f11aeb89ddb4c12062cc908d2f /wallet/build.gradle | |
parent | 5d3d85fa7190a70eea8fa67866c343005b9922b0 (diff) | |
download | taler-android-18f311512aec7b828c87c3b297135482abd389a2.tar.gz taler-android-18f311512aec7b828c87c3b297135482abd389a2.tar.bz2 taler-android-18f311512aec7b828c87c3b297135482abd389a2.zip |
[wallet] introduce build flavors for distribution channels
(google play, fdroid, nightly)
and show flavor name in dev settings
Diffstat (limited to 'wallet/build.gradle')
-rw-r--r-- | wallet/build.gradle | 28 |
1 files changed, 28 insertions, 0 deletions
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 |