Skip to content

Commit

Permalink
Creatae StagingApp class for staging build type
Browse files Browse the repository at this point in the history
  • Loading branch information
jmatsu committed Feb 2, 2019
1 parent 0b7023d commit fcaf0f0
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 fcaf0f0

Please sign in to comment.