Skip to content

Commit 38d9648

Browse files
authored
Merge pull request #748 from DroidKaigi/staging_app
Creatae StagingApp class for staging build type
2 parents ca67dea + fcaf0f0 commit 38d9648

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

frontend/android/build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ android {
105105
exclude 'META-INF/*.version'
106106
exclude 'META-INF/proguard/*.pro'
107107
}
108-
sourceSets {
109-
staging.java.srcDirs += 'src/debug/java'
110-
}
111108
}
112109

113110
dependencies {

frontend/android/proguard-rules-production.pro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Remove LogCat Tree anyway
22
-assumenosideeffects class io.github.droidkaigi.confsched2019.App {
3-
public *** enableLogCatLogging();
3+
public *** enableLogcatLogging();
44
}
55

66
# Remove Android Log's methods
@@ -11,6 +11,7 @@
1111
public static *** v(...);
1212
public static *** w(...);
1313
public static *** wtf(...);
14+
public static *** println(...);
1415
}
1516

1617
# Remove log methods which CrashlyticsTree doesn't support

frontend/android/src/staging/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
>
77

88
<application
9-
android:name=".DebugApp"
9+
android:name=".StagingApp"
1010
tools:replace="name"
1111
>
1212
</application>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package io.github.droidkaigi.confsched2019
2+
3+
import com.facebook.stetho.Stetho
4+
import com.squareup.leakcanary.LeakCanary
5+
6+
class StagingApp : App() {
7+
override fun onCreate() {
8+
super.onCreate()
9+
setupLeakCanary()
10+
setupStetho()
11+
}
12+
13+
private fun setupLeakCanary() {
14+
if (LeakCanary.isInAnalyzerProcess(this)) {
15+
return
16+
}
17+
LeakCanary.install(this)
18+
}
19+
20+
private fun setupStetho() {
21+
Stetho.initializeWithDefaults(this)
22+
}
23+
24+
override fun setupLogHandler() {
25+
super.setupLogHandler()
26+
enableLogcatLogging()
27+
}
28+
}

0 commit comments

Comments
 (0)