From 7abdfa72e372d927bf2dec3185e05588cb1a94b7 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Fri, 19 Jan 2018 13:14:38 +0100 Subject: #8822 adds leakCanary library to Bitmask for analyzing memory leaks --- app/build.gradle | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'app/build.gradle') diff --git a/app/build.gradle b/app/build.gradle index cb865ecd..a71cff57 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -77,6 +77,8 @@ dependencies { androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.6.3' testCompile 'junit:junit:4.12' testCompile 'org.json:json:20170516' + debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.4' + releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4' compile 'com.jakewharton:butterknife:6.1.0' provided 'com.squareup.dagger:dagger-compiler:1.2.2' compile 'com.github.pedrovgs:renderers:1.5' @@ -92,6 +94,17 @@ dependencies { compile 'com.android.support:support-fragment:26.1.0' } +// Ensure the no-op dependency is always used in JVM tests. +configurations.all { config -> + if (config.name.contains('UnitTest')) { + config.resolutionStrategy.eachDependency { details -> + if (details.requested.group == 'com.squareup.leakcanary' && details.requested.name == 'leakcanary-android') { + details.useTarget(group: details.requested.group, name: 'leakcanary-android-no-op', version: details.requested.version) + } + } + } +} + def processFileInplace(file, Closure processText) { def text = file.text file.write(processText(text)) -- cgit v1.2.3 From f7dfa7bc000b802570dddc19e8f274193e25b336 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Fri, 19 Jan 2018 15:56:27 +0100 Subject: #8822 add no-op leak canary to Beta build type --- app/build.gradle | 1 + 1 file changed, 1 insertion(+) (limited to 'app/build.gradle') diff --git a/app/build.gradle b/app/build.gradle index a71cff57..b28d9f35 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -79,6 +79,7 @@ dependencies { testCompile 'org.json:json:20170516' debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.4' releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4' + betaCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4' compile 'com.jakewharton:butterknife:6.1.0' provided 'com.squareup.dagger:dagger-compiler:1.2.2' compile 'com.github.pedrovgs:renderers:1.5' -- cgit v1.2.3