mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-16 16:40:06 +01:00
adding Leakcanary
This commit is contained in:
parent
bff373afac
commit
1ef3528a62
@ -21,11 +21,13 @@ android {
|
||||
buildTypes {
|
||||
debug {
|
||||
applicationIdSuffix ".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"
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,10 +41,17 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
leakCanaryVersion = '1.5.4'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'com.simplemobiletools:commons:2.38.5'
|
||||
compile 'com.facebook.stetho:stetho:1.5.0'
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
|
||||
debugCompile "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
|
||||
releaseCompile "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion"
|
||||
}
|
||||
|
||||
buildscript {
|
||||
|
@ -2,10 +2,19 @@ package com.simplemobiletools.notes
|
||||
|
||||
import android.app.Application
|
||||
import com.facebook.stetho.Stetho
|
||||
import com.simplemobiletools.notes.BuildConfig.USE_LEAK_CANARY
|
||||
import com.squareup.leakcanary.LeakCanary
|
||||
|
||||
class App : Application() {
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
if (USE_LEAK_CANARY) {
|
||||
if (LeakCanary.isInAnalyzerProcess(this)) {
|
||||
return
|
||||
}
|
||||
LeakCanary.install(this)
|
||||
}
|
||||
|
||||
if (BuildConfig.DEBUG)
|
||||
Stetho.initializeWithDefaults(this)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user