diff --git a/android/KMAPro/kMAPro/build.gradle b/android/KMAPro/kMAPro/build.gradle index 11ec4efd2d..94a29347b7 100644 --- a/android/KMAPro/kMAPro/build.gradle +++ b/android/KMAPro/kMAPro/build.gradle @@ -67,6 +67,7 @@ android { productFlavors { } + String tier = new File('../../TIER.md').getText('UTF-8').trim(); applicationVariants.all { variant -> // Append tag to app name to help differentiate versions for app testers: // - stable builds have no suffix @@ -75,7 +76,7 @@ android { // - PR builds also have "-test-1234" suffix (where 1234 is PR#) // Gradle sync will nullify these values, so have a fallback String appSuffix = '' - String tag = VERSION_TAG ? VERSION_TAG : '-' + new File('../../TIER.md').getText('UTF-8'); + String tag = VERSION_TAG ? VERSION_TAG : '-' + tier; if (tag.startsWithAny("-beta", "beta")) { appSuffix = ' Beta'; } else if (tag.startsWithAny("-alpha", "alpha")) { @@ -127,7 +128,7 @@ if (env_keys_json_file != null && file(env_keys_json_file).exists()) { // Deactivate lower conflicting version APKs resolutionStrategy.set(com.github.triplet.gradle.androidpublisher.ResolutionStrategy.IGNORE) - switch (System.env.TIER) { + switch (String.valueOf(tier)) { case 'beta': track.set("beta") println "TIER set to beta" diff --git a/oem/firstvoices/android/app/build.gradle b/oem/firstvoices/android/app/build.gradle index fa5dc5a127..dfe37e3c59 100644 --- a/oem/firstvoices/android/app/build.gradle +++ b/oem/firstvoices/android/app/build.gradle @@ -54,6 +54,7 @@ android { productFlavors { } + String tier = new File('../../../TIER.md').getText('UTF-8').trim(); applicationVariants.all { variant -> // Adjust output name to "firstvoices-${VERSION_MD}.apk" variant.outputs.all { @@ -95,7 +96,7 @@ if (env_keys_json_file != null && file(env_keys_json_file).exists()) { // Deactivate lower conflicting version APKs resolutionStrategy.set(com.github.triplet.gradle.androidpublisher.ResolutionStrategy.IGNORE) - switch (System.env.TIER) { + switch (String.valueOf(tier)) { case 'beta': track.set("beta") println "TIER set to beta"