adding LeakCanary

This commit is contained in:
tibbi 2017-11-09 20:56:53 +01:00
parent a9bb73fcaa
commit 27da8b4841
2 changed files with 19 additions and 0 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"
}
}
@ -36,12 +40,19 @@ android {
}
}
ext {
leakCanaryVersion = '1.5.4'
}
dependencies {
compile 'com.simplemobiletools:commons:2.38.2'
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile files('../libs/RootTools.jar')
debugCompile "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
releaseCompile "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion"
}
buildscript {

View File

@ -2,12 +2,20 @@ package com.simplemobiletools.filemanager
import android.app.Application
import com.github.ajalt.reprint.core.Reprint
import com.simplemobiletools.filemanager.BuildConfig.USE_LEAK_CANARY
import com.simplemobiletools.filemanager.extensions.config
import com.squareup.leakcanary.LeakCanary
import java.util.*
class App : Application() {
override fun onCreate() {
super.onCreate()
if (USE_LEAK_CANARY) {
if (LeakCanary.isInAnalyzerProcess(this)) {
return
}
LeakCanary.install(this)
}
if (config.useEnglish) {
val conf = resources.configuration