Skip to content

Commit

Permalink
double down on jvmdefault
Browse files Browse the repository at this point in the history
  • Loading branch information
F43nd1r committed Jul 23, 2021
1 parent 0b05581 commit 783bbe6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions acra-core/src/main/java/org/acra/collector/Collector.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ interface Collector : Plugin {
/**
* @return when this collector should be called compared to other collectors
*/
@JvmDefault
val order: Order
get() = Order.NORMAL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ interface ReportingAdministrator : Plugin {
* @param reportBuilder the reportBuilder for the report about to be collected
* @return if this report should be collected
*/
@JvmDefault
fun shouldStartCollecting(context: Context, config: CoreConfiguration, reportBuilder: ReportBuilder): Boolean {
return true
}
Expand All @@ -48,6 +49,7 @@ interface ReportingAdministrator : Plugin {
* @param crashReportData the collected report
* @return if this report should be sent
*/
@JvmDefault
fun shouldSendReport(context: Context, config: CoreConfiguration, crashReportData: CrashReportData): Boolean {
return true
}
Expand All @@ -58,8 +60,10 @@ interface ReportingAdministrator : Plugin {
* @param context a context
* @param config the current config
*/
@JvmDefault
fun notifyReportDropped(context: Context, config: CoreConfiguration) {}

@JvmDefault
fun shouldFinishActivity(context: Context, config: CoreConfiguration, lastActivityManager: LastActivityManager): Boolean {
return true
}
Expand All @@ -73,6 +77,7 @@ interface ReportingAdministrator : Plugin {
* @param crashReportData the collected report
* @return if the application should be killed
*/
@JvmDefault
fun shouldKillApplication(context: Context, config: CoreConfiguration, reportBuilder: ReportBuilder,
crashReportData: CrashReportData?): Boolean {
return true
Expand Down
1 change: 1 addition & 0 deletions acra-core/src/main/java/org/acra/plugins/Plugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ interface Plugin {
* @param config the current config
* @return if this instance should be called
*/
@JvmDefault
fun enabled(config: CoreConfiguration): Boolean {
return true
}
Expand Down
3 changes: 3 additions & 0 deletions acra-core/src/main/java/org/acra/sender/ReportSender.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ interface ReportSender {
* @param errorContent Stores key/value pairs for each report field.
* @throws ReportSenderException If anything goes fatally wrong during the handling of crash data, you can (should) throw a [ReportSenderException] with a custom message.
*/
@JvmDefault
@Throws(ReportSenderException::class)
fun send(context: Context, errorContent: CrashReportData) {
}
Expand All @@ -53,9 +54,11 @@ interface ReportSender {
* @param extras additional information set in a [org.acra.scheduler.DefaultSenderScheduler]
* @throws ReportSenderException If anything goes fatally wrong during the handling of crash data, you can (should) throw a [ReportSenderException] with a custom message.
*/
@JvmDefault
@Throws(ReportSenderException::class)
fun send(context: Context, errorContent: CrashReportData, extras: Bundle) = send(context, errorContent)

@JvmDefault
fun requiresForeground(): Boolean {
return false
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/acra-android-library.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ dependencies {
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xjvm-default=all")
freeCompilerArgs = listOf("-Xjvm-default=enable")
}
}

Expand Down

0 comments on commit 783bbe6

Please sign in to comment.