summaryrefslogtreecommitdiff
path: root/app/build.gradle
diff options
context:
space:
mode:
authorfupduck <fupduck@riseup.net>2018-01-19 08:42:32 -0800
committerfupduck <fupduck@riseup.net>2018-01-19 08:42:32 -0800
commitdbda5fbf23ccad615e932be6b8869fe34a6b440d (patch)
tree4579483020300b393895248e06395a6d22fd3579 /app/build.gradle
parent7d4129b2854e25c42b6df766d30671c91fc699ae (diff)
parentf7dfa7bc000b802570dddc19e8f274193e25b336 (diff)
Merge branch '#8822_add_leakCanary_to_project' into '0.9.8'
#8822 adds leakCanary library to Bitmask for analyzing memory leaks See merge request leap/bitmask_android!27
Diffstat (limited to 'app/build.gradle')
-rw-r--r--app/build.gradle14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/build.gradle b/app/build.gradle
index cb865ecd..b28d9f35 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -77,6 +77,9 @@ 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'
+ 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'
@@ -92,6 +95,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))