Skip to content

Commit e17d840

Browse files
authored
Merge pull request #5 from EndlessCodeGroup/feature/java-interop
Better Java interop
2 parents f056de1 + f5cf55a commit e17d840

11 files changed

Lines changed: 18 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
## [Unreleased]
22

3+
### Changed
4+
5+
- Better interoperability with Java
6+
37
### Housekeeping
48

59
- Migrate from jCenter to Maven Central
10+
- Update Gradle to 6.8.3
11+
- Update Sentry to 4.2.0
612

713
## [0.10.1]
814

buildSrc/src/main/kotlin/commons.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ tasks.withType<KotlinCompile>().configureEach {
2727
jvmTarget = "1.8"
2828
apiVersion = "1.4"
2929
languageVersion = "1.4"
30+
freeCompilerArgs += "-Xjvm-default=enable"
3031
}
3132
}

buildSrc/src/main/kotlin/dependencies.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@file:Suppress("ClassName")
22

3-
const val sentry = "io.sentry:sentry:4.0.0-beta.1"
3+
const val sentry = "io.sentry:sentry:4.2.0"
44

55
object fuel {
66
private const val group = "com.github.kittinunf.fuel"

inspector-api/src/main/kotlin/report/ReportEnvironment.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package ru.endlesscode.inspector.report
33
public interface ReportEnvironment {
44

55
public companion object {
6+
@JvmStatic
67
public val EMPTY: ReportEnvironment = object : ReportEnvironment {
78
override val appName: String = ""
89
override val appVersion: String = ""

inspector-api/src/main/kotlin/report/ReportFields.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public interface ReportField {
1111
public val value: String
1212
public val show: Boolean
1313

14+
@JvmDefault
1415
public fun render(
1516
short: Boolean = true,
1617
separator: String = ": ",

inspector-api/src/main/kotlin/report/Reporter.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public interface Reporter {
1414
/**
1515
* Alias for [addHandler] method.
1616
*/
17+
@JvmDefault
1718
public fun addHandler(
1819
beforeReport: (String, ExceptionData) -> Unit = { _, _ -> },
1920
onSuccess: (String, ExceptionData) -> Unit = { _, _ -> },
@@ -44,6 +45,7 @@ public interface Reporter {
4445
/**
4546
* Report about [exception] with the [message] that describes when exception thrown (asynchronously).
4647
*/
48+
@JvmDefault
4749
public fun report(message: String, exception: Exception) {
4850
report(message, exception, async = true)
4951
}
@@ -61,6 +63,7 @@ public interface Reporter {
6163
* @param message The message that will be used as title
6264
* @param block Block that should be executed
6365
*/
66+
@JvmDefault
6467
public fun track(message: String, block: () -> Unit) {
6568
try {
6669
block.invoke()

inspector-api/src/main/kotlin/report/ReporterFocus.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package ru.endlesscode.inspector.report
66
public interface ReporterFocus {
77

88
public companion object {
9+
@JvmStatic
910
public val NO_FOCUS: ReporterFocus = object : ReporterFocus {
1011
override val focusedPackage: String = ""
1112
override val environment: ReportEnvironment = ReportEnvironment.EMPTY

inspector-bukkit/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import ru.endlesscode.bukkitgradle.dependencies.spigotApi
44
// Bukkit implementation build config
55

66
plugins {
7-
id("ru.endlesscode.bukkitgradle") version "0.9.1"
7+
id("ru.endlesscode.bukkitgradle") version "0.9.2"
88
publish
99
}
1010

inspector-bukkit/src/main/kotlin/report/BukkitEnvironment.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public class BukkitEnvironment internal constructor(
1919
public const val FIELD_INSPECTOR_VERSION: String = "Inspector version"
2020
public const val FIELD_REPORTER_ID: String = "Reporter ID"
2121

22-
@JvmStatic
2322
internal val DEFAULT_PROPERTIES = Properties()
2423
}
2524

@@ -42,7 +41,7 @@ public class BukkitEnvironment internal constructor(
4241
).showOnlyIf { inspector.shouldSendData(DataType.PLUGINS) },
4342

4443
FIELD_INSPECTOR_VERSION to TextField(FIELD_INSPECTOR_VERSION, Inspector.version),
45-
FIELD_REPORTER_ID to TextField(FIELD_REPORTER_ID, inspector.serverId.toString())
44+
FIELD_REPORTER_ID to TextField(FIELD_REPORTER_ID, inspector.serverId.toString()),
4645
)
4746

4847
override val isInspectorEnabled: Boolean

inspector-discord-reporter/http/hastebin.http

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
POST https://hastebin.com/documents
2-
Content-type: text/plain
2+
Content-Type: text/plain
33

44
Test content
55

0 commit comments

Comments
 (0)