Skip to content

Commit

Permalink
Add bugsnag
Browse files Browse the repository at this point in the history
  • Loading branch information
mehatab committed May 19, 2020
1 parent 47f036a commit 39dc6fe
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
4 changes: 1 addition & 3 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
/build
/src/main/res/values/secrets.xml
/src/main/res/values/keys.xml
/build
13 changes: 12 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: "com.bugsnag.android.gradle"


android {
Expand All @@ -20,6 +19,17 @@ android {
versionName Config.versionName
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

buildConfigField "String", 'BUGSNAG_API_KEY', "\"${localProperties['bugsnagKey']}\""
}

signingConfigs {
release {
storeFile file("covid.jks")
storePassword "covid@123"
keyAlias "covid"
keyPassword "covid@123"
}
}

buildTypes {
Expand All @@ -34,6 +44,7 @@ android {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}

Expand Down
10 changes: 2 additions & 8 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
android:supportsRtl="true"
android:name=".CovidApp"
android:theme="@style/Covid">

<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -21,13 +22,6 @@
</intent-filter>
</activity>

<uses-library
android:name="org.apache.http.legacy"
android:required="false" />

<meta-data
android:name="com.bugsnag.android.API_KEY"
android:value="@string/bugsnag_key"/>
</application>

</manifest>
</manifest>
10 changes: 9 additions & 1 deletion app/src/main/java/info/covid/CovidApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,19 @@ import info.covid.uicomponents.di.uiComponentsModule
import org.koin.android.ext.koin.androidContext
import org.koin.core.context.startKoin


class CovidApp : Application() {

override fun onCreate() {
super.onCreate()
Bugsnag.start(this)

if (BuildConfig.DEBUG.not()) {
with(Bugsnag.init(this, BuildConfig.BUGSNAG_API_KEY)){
setReleaseStage(BuildConfig.BUILD_TYPE)
setProjectPackages("info.covid")
}
}


startKoin {
androidContext(this@CovidApp)
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object Versions {

const val preference = "1.1.0"
const val koin = "2.0.1"
const val bugsnag = "5.0.0"
const val bugsnag = "4.11.0"
}

object Deps {
Expand Down

0 comments on commit 39dc6fe

Please sign in to comment.