Bug 1430417 - Do not include LeakCanary in automation builds. r=JanH
This got mixed up by
Bug 1411654, which migrated to Android-Gradle
3.0+. However, it's also much easier to fix due to the changes in the
new version! This patch uses the new audience flavor dimension to
control the version of LeakCanary included.
Note that this turns off LeakCanary for builds produced by |mach
build|, because |mach build| always builds the official audience
flavor dimension. We could use MOZILLA_OFFICIAL to differentiate, but
it's not worth it: local developers who care about LeakCanary
will/should be running a local audience flavor dimension from Android
Studio.
MozReview-Commit-ID: ASgxhNOMsWc
--- a/mobile/android/app/build.gradle
+++ b/mobile/android/app/build.gradle
@@ -228,21 +228,21 @@ dependencies {
if (mozconfig.substs.MOZ_ANDROID_GCM) {
implementation "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
implementation "com.google.android.gms:play-services-base:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
implementation "com.google.android.gms:play-services-gcm:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
implementation "com.google.android.gms:play-services-measurement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
}
- // Include LeakCanary in most gradle based builds. Gradle based tests
- // include the no-op version. Mach based builds only include the no-op
- // version of this library.
- debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
- releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
+ // Include LeakCanary in local builds, but not in official builds. Mach
+ // builds target the official audience, so LeakCanary will not be included
+ // in any Mach build.
+ localImplementation 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
+ officialImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
testImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
implementation project(path: ':geckoview')
implementation project(path: ':thirdparty')
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:3.5.1'
testImplementation 'org.simpleframework:simple-http:6.0.1'