initialize Stetho only in debug build

This commit is contained in:
tibbi 2017-12-01 20:32:54 +01:00
parent 89a6149f53
commit 9a6ee91180
2 changed files with 3 additions and 8 deletions

View file

@ -21,14 +21,10 @@ 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"
}
}
@ -47,7 +43,7 @@ ext {
}
dependencies {
implementation 'com.simplemobiletools:commons:3.0.20'
implementation 'com.simplemobiletools:commons:3.0.21'
implementation 'joda-time:joda-time:2.9.9'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.android.support:multidex:1.0.2'

View file

@ -2,21 +2,20 @@ package com.simplemobiletools.calendar
import android.support.multidex.MultiDexApplication
import com.facebook.stetho.Stetho
import com.simplemobiletools.calendar.BuildConfig.USE_LEAK_CANARY
import com.simplemobiletools.commons.extensions.checkUseEnglish
import com.squareup.leakcanary.LeakCanary
class App : MultiDexApplication() {
override fun onCreate() {
super.onCreate()
if (USE_LEAK_CANARY) {
if (BuildConfig.DEBUG) {
if (LeakCanary.isInAnalyzerProcess(this)) {
return
}
LeakCanary.install(this)
Stetho.initializeWithDefaults(this)
}
checkUseEnglish()
Stetho.initializeWithDefaults(this)
}
}