Skip to content

Commit 40101f0

Browse files
Update Kotlin [1.8.20 -> 2.0.21], compatible with Gradle 8.7 #215
Update coroutines to match, dokka to latest available version.
1 parent fa93fad commit 40101f0

6 files changed

Lines changed: 29 additions & 18 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ target/
1313
out/
1414
classes/
1515

16+
# Kotlin
17+
.kotlin
18+
1619
# Local build properties
1720
build.properties
1821
local.properties

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Notable changes to the ObjectBox Java library.
44

55
For more insights into what changed in the ObjectBox C++ core, [check the ObjectBox C changelog](https://github.com/objectbox/objectbox-c/blob/main/CHANGELOG.md).
66

7+
## 4.3.1 - in development
8+
9+
- Requires at least Kotlin compiler and standard library 1.7.
10+
711
## 4.3.0 - 2025-05-13
812

913
- Basic support for boolean array properties (`boolean[]` in Java or `BooleanArray` in Kotlin).

build.gradle.kts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,17 @@ buildscript {
5252
val essentialsVersion by extra("3.1.0")
5353
val junitVersion by extra("4.13.2")
5454
val mockitoVersion by extra("3.8.0")
55-
// The versions of Kotlin, Kotlin Coroutines and Dokka must work together.
56-
// Check https://github.com/Kotlin/kotlinx.coroutines#readme
57-
// and https://github.com/Kotlin/dokka/releases
58-
// Note: when updating might also have to increase the minimum compiler version supported
55+
// The versions of Gradle, Kotlin and Kotlin Coroutines must work together.
56+
// Check
57+
// - https://kotlinlang.org/docs/gradle-configure-project.html#apply-the-plugin
58+
// - https://github.com/Kotlin/kotlinx.coroutines#readme
59+
// Note: when updating to a new minor version also have to increase the minimum compiler version supported
5960
// by consuming projects, see objectbox-kotlin/ build script.
60-
val kotlinVersion by extra("1.8.20")
61-
val coroutinesVersion by extra("1.7.3")
62-
val dokkaVersion by extra("1.8.20")
61+
val kotlinVersion by extra("2.0.21")
62+
val coroutinesVersion by extra("1.9.0")
63+
// Dokka includes its own version of the Kotlin compiler, so it must not match the used Kotlin version.
64+
// But it might not understand new language features.
65+
val dokkaVersion by extra("1.9.20")
6366

6467
repositories {
6568
mavenCentral()

objectbox-kotlin/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ tasks.withType<KotlinCompile> {
2323
// Kotlin supports the development with at least three previous versions, so pick the oldest one possible.
2424
// https://kotlinlang.org/docs/kotlin-evolution.html#evolving-the-binary-format
2525
// https://kotlinlang.org/docs/compatibility-modes.html
26-
apiVersion = "1.5"
27-
languageVersion = "1.5"
26+
apiVersion = "1.7"
27+
languageVersion = "1.7"
2828
}
2929
}
3030

objectbox-rxjava3/build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import org.jetbrains.dokka.gradle.DokkaTask
2-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
33
import java.net.URL
44

55
plugins {
@@ -15,10 +15,10 @@ tasks.withType<JavaCompile> {
1515
options.release.set(8)
1616
}
1717

18-
// Produce Java 8 byte code, would default to Java 6.
19-
tasks.withType<KotlinCompile> {
20-
kotlinOptions {
21-
jvmTarget = "1.8"
18+
kotlin {
19+
compilerOptions {
20+
// Produce Java 8 byte code, would default to Java 6
21+
jvmTarget.set(JvmTarget.JVM_1_8)
2222
}
2323
}
2424

tests/objectbox-java-test/build.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
22
import org.gradle.api.tasks.testing.logging.TestLogEvent
3+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
34

45
plugins {
56
id("java-library")
@@ -12,10 +13,10 @@ tasks.withType<JavaCompile> {
1213
options.release.set(8)
1314
}
1415

15-
// Produce Java 8 byte code, would default to Java 6.
16-
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
17-
kotlinOptions {
18-
jvmTarget = "1.8"
16+
kotlin {
17+
compilerOptions {
18+
// Produce Java 8 byte code, would default to Java 6
19+
jvmTarget.set(JvmTarget.JVM_1_8)
1920
}
2021
}
2122

0 commit comments

Comments
 (0)