initialize leak canary in debug build

This commit is contained in:
tibbi 2017-11-07 17:31:40 +01:00
parent add3760ed2
commit 54dca20bdb
2 changed files with 7 additions and 2 deletions

View file

@ -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"
}
}

View file

@ -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)
}
}