From bb59ac642304dbdc01d2bb422d2eeb3c0bcdeb77 Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Fri, 15 Nov 2019 18:21:11 +0100 Subject: [PATCH] Issue #6622, #6688: Create a "fennecBeta" and "fennecNightly" build types. --- app/build.gradle | 51 ++++++++++++++++++- .../AndroidManifest.xml | 0 .../fenix/MigratingFenixApplication.kt | 0 3 files changed, 49 insertions(+), 2 deletions(-) rename app/src/{fennecProduction => migration}/AndroidManifest.xml (100%) rename app/src/{fennecProduction => migration}/java/org/mozilla/fenix/MigratingFenixApplication.kt (100%) diff --git a/app/build.gradle b/app/build.gradle index 72624c783..3f65eafa8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -80,6 +80,34 @@ android { "sharedUserId": "org.mozilla.firefox.sharedID" ] } + fennecBeta releaseTemplate >> { + buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true" + applicationIdSuffix ".firefox_beta" + manifestPlaceholders = [ + // This release type is meant to replace Firefox (Release channel) and therefore needs to inherit + // its sharedUserId for all eternity. See: + // https://searchfox.org/mozilla-central/search?q=moz_android_shared_id&case=false®exp=false&path= + // Shipping an app update without sharedUserId can have + // fatal consequences. For example see: + // - https://issuetracker.google.com/issues/36924841 + // - https://issuetracker.google.com/issues/36905922 + "sharedUserId": "org.mozilla.firefox.sharedID" + ] + } + fennecNightly releaseTemplate >> { + buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true" + applicationIdSuffix ".fennec_aurora" + manifestPlaceholders = [ + // This release type is meant to replace Firefox (Release channel) and therefore needs to inherit + // its sharedUserId for all eternity. See: + // https://searchfox.org/mozilla-central/search?q=moz_android_shared_id&case=false®exp=false&path= + // Shipping an app update without sharedUserId can have + // fatal consequences. For example see: + // - https://issuetracker.google.com/issues/36924841 + // - https://issuetracker.google.com/issues/36905922 + "sharedUserId": "org.mozilla.fennec.sharedID" + ] + } } variantFilter { // There's a "release" build type that exists by default that we don't use (it's replaced by "nightly" and "beta") @@ -97,7 +125,8 @@ android { // | fenixBeta | ❌ | ✅ | Fenix Beta ships with GV Beta // | fenixProduction | ❌ | ✅ | Fenix Production ships with GV Beta // | fennecProduction | ❌ | ✅ | Fenix build to replace production Firefox builds - // + // | fennecBeta | ❌ | ✅ | Fenix build to replace beta Firefox builds + // | fennecNightly | ✅ | ❌ | Fenix build to replace Nightly Firefox builds def flavors = flavors*.name.toString().toLowerCase() @@ -109,7 +138,11 @@ android { setIgnore true } - if (buildType.name == 'fennecProduction' && flavors.contains("geckonightly")) { + if ((buildType.name == 'fennecProduction' || buildType.name == 'fennecBeta') && flavors.contains("geckonightly")) { + setIgnore true + } + + if (buildType.name == 'fennecNightly' && flavors.contains("geckobeta")) { setIgnore true } } @@ -125,6 +158,18 @@ android { androidTest { resources.srcDirs += ['src/androidTest/resources'] } + fennecNightly { + java.srcDirs = ['src/migration/java'] + manifest.srcFile "src/migration/AndroidManifest.xml" + } + fennecBeta { + java.srcDirs = ['src/migration/java'] + manifest.srcFile "src/migration/AndroidManifest.xml" + } + fennecProduction { + java.srcDirs = ['src/migration/java'] + manifest.srcFile "src/migration/AndroidManifest.xml" + } } productFlavors { @@ -397,6 +442,8 @@ dependencies { // We only care about support-migration in builds that will be overwriting Fennec. fennecProductionImplementation Deps.mozilla_support_migration + fennecBetaImplementation Deps.mozilla_support_migration + fennecNightlyImplementation Deps.mozilla_support_migration implementation Deps.mozilla_ui_colors implementation Deps.mozilla_ui_icons diff --git a/app/src/fennecProduction/AndroidManifest.xml b/app/src/migration/AndroidManifest.xml similarity index 100% rename from app/src/fennecProduction/AndroidManifest.xml rename to app/src/migration/AndroidManifest.xml diff --git a/app/src/fennecProduction/java/org/mozilla/fenix/MigratingFenixApplication.kt b/app/src/migration/java/org/mozilla/fenix/MigratingFenixApplication.kt similarity index 100% rename from app/src/fennecProduction/java/org/mozilla/fenix/MigratingFenixApplication.kt rename to app/src/migration/java/org/mozilla/fenix/MigratingFenixApplication.kt