Bug 1363526 - Revert .App rewriting to restore Android Studio launch for developers. r=maliu draft
authorNick Alexander <nalexander@mozilla.com>
Tue, 09 May 2017 14:06:18 -0700
changeset 575092 62d113e85453bb695b59e780653a34cab199872f
parent 575089 cd998119b1d27c5a9941ea2dd32b01ff6023e1e8
child 627813 af16d203cec0f3d36279cd2c5d9ab16f195f12fe
push id57944
push usernalexander@mozilla.com
push dateTue, 09 May 2017 21:06:36 +0000
reviewersmaliu
bugs1363526, 1320310
milestone55.0a1
Bug 1363526 - Revert .App rewriting to restore Android Studio launch for developers. r=maliu Per https://bugzilla.mozilla.org/show_bug.cgi?id=1320310#c14, the fix for Bug 1320310 interferes with the Android Studio launch experience. This reverts that change for non-official audiences, i.e., the local{Old} configurations used by developers. MozReview-Commit-ID: 2Mc5MUj8Utl
mobile/android/app/build.gradle
--- a/mobile/android/app/build.gradle
+++ b/mobile/android/app/build.gradle
@@ -504,20 +504,28 @@ android.applicationVariants.all { varian
 }
 
 // Bug 1353055 - Strip 'vars' debugging information to agree with moz.build.
 apply from: "${topsrcdir}/mobile/android/gradle/debug_level.gradle"
 android.applicationVariants.all configureVariantDebugLevel
 
 
 // Bug 1320310 - Hack up the manifest produced by Gradle to match that produced
-// by moz.build.
+// by moz.build.  Per https://bugzilla.mozilla.org/show_bug.cgi?id=1320310#c14,
+// this breaks launching in Android Studio; therefore, we only do this for
+// official automation builds and not for local developer builds.
 import groovy.xml.XmlUtil
 
 android.applicationVariants.all { variant ->
+    // Like 'local', 'localOld', or 'official'.
+    def audienceDimension = variant.productFlavors[0].name
+    if (!audienceDimension.equals('official')) {
+        return
+    }
+
     variant.outputs.each { output ->
         output.processManifest.doLast {
             [output.processManifest.manifestOutputFile,
              output.processManifest.instantRunManifestOutputFile,
             ].each({ File manifestOutFile ->
                 if (manifestOutFile.exists()) {
                     def contents = manifestOutFile.getText('UTF-8')