From 54dca20bdbe906837dbe703287d3ff17afe814f4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 7 Nov 2017 17:31:40 +0100 Subject: [PATCH] initialize leak canary in debug build --- app/build.gradle | 4 ++++ app/src/main/kotlin/com/simplemobiletools/gallery/App.kt | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9e9ca81a2..9fe78e00f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,10 +19,14 @@ android { } buildTypes { + debug { + buildConfigField "boolean", "USE_LEAK_CANARY", "true" + } release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release + buildConfigField "boolean", "USE_LEAK_CANARY", "false" } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt index 48ef23b19..6141c6c76 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt @@ -2,18 +2,19 @@ package com.simplemobiletools.gallery import android.app.Application import com.github.ajalt.reprint.core.Reprint +import com.simplemobiletools.gallery.BuildConfig.USE_LEAK_CANARY import com.squareup.leakcanary.LeakCanary class App : Application() { - val USE_LEAK_CANARY = false override fun onCreate() { super.onCreate() - Reprint.initialize(this) if (USE_LEAK_CANARY) { if (LeakCanary.isInAnalyzerProcess(this)) { return } LeakCanary.install(this) } + + Reprint.initialize(this) } }