simplify Leak Canary initialization

This commit is contained in:
tibbi 2017-12-01 23:35:36 +01:00
parent 76e94d2bab
commit a56bbbd54a
2 changed files with 2 additions and 7 deletions

View File

@ -21,14 +21,10 @@ android {
} }
buildTypes { buildTypes {
debug {
buildConfigField "boolean", "USE_LEAK_CANARY", "true"
}
release { release {
minifyEnabled true minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release signingConfig signingConfigs.release
buildConfigField "boolean", "USE_LEAK_CANARY", "false"
} }
} }
@ -47,7 +43,7 @@ ext {
} }
dependencies { dependencies {
implementation 'com.simplemobiletools:commons:3.0.20' implementation 'com.simplemobiletools:commons:3.0.21'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.8.0' implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.8.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.0'
implementation 'com.android.support:multidex:1.0.2' implementation 'com.android.support:multidex:1.0.2'

View File

@ -3,13 +3,12 @@ package com.simplemobiletools.gallery
import android.support.multidex.MultiDexApplication import android.support.multidex.MultiDexApplication
import com.github.ajalt.reprint.core.Reprint import com.github.ajalt.reprint.core.Reprint
import com.simplemobiletools.commons.extensions.checkUseEnglish import com.simplemobiletools.commons.extensions.checkUseEnglish
import com.simplemobiletools.gallery.BuildConfig.USE_LEAK_CANARY
import com.squareup.leakcanary.LeakCanary import com.squareup.leakcanary.LeakCanary
class App : MultiDexApplication() { class App : MultiDexApplication() {
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
if (USE_LEAK_CANARY) { if (BuildConfig.DEBUG) {
if (LeakCanary.isInAnalyzerProcess(this)) { if (LeakCanary.isInAnalyzerProcess(this)) {
return return
} }