Skip to content

Commit

Permalink
Merge pull request #748 from DroidKaigi/staging_app
Browse files Browse the repository at this point in the history
Creatae StagingApp class for staging build type
  • Loading branch information
jmatsu authored Feb 2, 2019
2 parents ca67dea + fcaf0f0 commit 38d9648
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
3 changes: 0 additions & 3 deletions frontend/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ android {
exclude 'META-INF/*.version'
exclude 'META-INF/proguard/*.pro'
}
sourceSets {
staging.java.srcDirs += 'src/debug/java'
}
}

dependencies {
Expand Down
3 changes: 2 additions & 1 deletion frontend/android/proguard-rules-production.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Remove LogCat Tree anyway
-assumenosideeffects class io.github.droidkaigi.confsched2019.App {
public *** enableLogCatLogging();
public *** enableLogcatLogging();
}

# Remove Android Log's methods
Expand All @@ -11,6 +11,7 @@
public static *** v(...);
public static *** w(...);
public static *** wtf(...);
public static *** println(...);
}

# Remove log methods which CrashlyticsTree doesn't support
Expand Down
2 changes: 1 addition & 1 deletion frontend/android/src/staging/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
>

<application
android:name=".DebugApp"
android:name=".StagingApp"
tools:replace="name"
>
</application>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package io.github.droidkaigi.confsched2019

import com.facebook.stetho.Stetho
import com.squareup.leakcanary.LeakCanary

class StagingApp : App() {
override fun onCreate() {
super.onCreate()
setupLeakCanary()
setupStetho()
}

private fun setupLeakCanary() {
if (LeakCanary.isInAnalyzerProcess(this)) {
return
}
LeakCanary.install(this)
}

private fun setupStetho() {
Stetho.initializeWithDefaults(this)
}

override fun setupLogHandler() {
super.setupLogHandler()
enableLogcatLogging()
}
}

0 comments on commit 38d9648

Please sign in to comment.