-
Notifications
You must be signed in to change notification settings - Fork 8
Add optional crash reporting #331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,12 @@ | ||
| package com.ivanovsky.passnotes | ||
|
|
||
| import android.app.Application | ||
| import android.content.Context | ||
| import com.ivanovsky.passnotes.data.repository.settings.Settings | ||
| import com.ivanovsky.passnotes.data.repository.settings.SettingsImpl | ||
| import com.ivanovsky.passnotes.domain.logger.LoggerInteractor | ||
| import com.ivanovsky.passnotes.domain.loggingAndReporting.CrashReporterInteractor | ||
| import com.ivanovsky.passnotes.domain.loggingAndReporting.LoggerInteractor | ||
| import com.ivanovsky.passnotes.injection.AppStartDependencies | ||
| import com.ivanovsky.passnotes.injection.DIModuleBuilder | ||
| import com.ivanovsky.passnotes.injection.DebugModuleBuilder | ||
| import com.ivanovsky.passnotes.injection.DefaultModuleBuilder | ||
| import org.koin.android.ext.koin.androidContext | ||
| import org.koin.android.ext.koin.androidLogger | ||
|
|
@@ -15,29 +16,33 @@ open class App : Application() { | |
|
|
||
| open fun configureModuleBuilder(builder: DIModuleBuilder) { | ||
| // implementation should be flavor specific | ||
| if (BuildConfig.IS_AUTOMATION_BUILD) { | ||
| builder.isExternalStorageAccessEnabled = true | ||
| } | ||
| } | ||
|
|
||
| override fun onCreate() { | ||
| super.onCreate() | ||
|
|
||
| val settings = SettingsImpl(context = this) | ||
| val loggerInteractor = LoggerInteractor(context = this, settings) | ||
| .apply { | ||
| initialize() | ||
| } | ||
|
|
||
| val moduleBuilder = if (BuildConfig.DEBUG) { | ||
| val type = Class.forName("com.ivanovsky.passnotes.injection.DebugModuleBuilder") | ||
|
|
||
| val constructor = type.getConstructor( | ||
| Context::class.java, | ||
| LoggerInteractor::class.java, | ||
| Settings::class.java | ||
| ) | ||
| val deps = AppStartDependencies( | ||
| context = this, | ||
| settings = settings, | ||
| loggerInteractor = LoggerInteractor(context = this, settings) | ||
| .apply { | ||
| initialize() | ||
| }, | ||
| crashReporterInteractor = CrashReporterInteractor(context = this) | ||
| .apply { | ||
| initialize(settings) | ||
| } | ||
| ) | ||
|
|
||
| constructor.newInstance(this, loggerInteractor, settings) as DIModuleBuilder | ||
| val moduleBuilder = if (BuildConfig.DEBUG) { | ||
| DebugModuleBuilder(deps) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because Useful? React with 👍 / 👎. |
||
| } else { | ||
| DefaultModuleBuilder(loggerInteractor) | ||
| DefaultModuleBuilder(deps) | ||
| } | ||
|
|
||
| configureModuleBuilder(moduleBuilder) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On tag builds this step now asks the shell to execute a command literally named
app:assembleFdroidRelease, so the GitHub release job will stop withcommand not foundbefore any APKs are produced or renamed. This should still invoke Gradle, e.g. through./gradlew, as the pipeline workflow does for these tasks.Useful? React with 👍 / 👎.