Skip to content

Commit 9dab3e3

Browse files
authored
Merge pull request #1087 from Kotlin/post-java-11-bumps
Post Java 11 version bumps
2 parents f697d1c + f05e29e commit 9dab3e3

File tree

11 files changed

+558
-609
lines changed

11 files changed

+558
-609
lines changed

.github/workflows/generated-sources-master.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
- name: Checkout repository
1414
uses: actions/checkout@v4
1515

16-
- name: Set up JDK 11
16+
- name: Set up JDK 21
1717
uses: actions/setup-java@v4
1818
with:
1919
distribution: 'temurin'
20-
java-version: '11'
20+
java-version: '21'
2121

2222
- name: Run Gradle task
2323
run: ./gradlew :core:processKDocsMain korro

.github/workflows/generated-sources.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ jobs:
2626
- name: Checkout repository
2727
uses: actions/checkout@v4
2828

29-
- name: Set up JDK 11
29+
- name: Set up JDK 21
3030
uses: actions/setup-java@v4
3131
with:
3232
distribution: 'temurin'
33-
java-version: '11'
33+
java-version: '21'
3434

3535
- name: Configure Git User
3636
run: |

CONTRIBUTING.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,14 @@ so do familiarize yourself with the following guidelines.
8585

8686
## Environment requirements
8787

88-
* JDK >= 11 referred to by the `JAVA_HOME` environment variable.
88+
* JDK >= 21 referred to by the `JAVA_HOME` environment variable.
8989

90-
* Note, any version above 11 should work in theory, but JDK 11 is the only version we test with,
90+
* Note, any version above 21 should work in theory, but JDK 21 is the only version we test with,
9191
so it is the recommended version.
9292

93+
* JDK == 11 referred to by the `JDK_11_0` environment variable or `gradle.properties`/`local.properties`.
94+
* This is used for testing our compiler plugins.
95+
9396
* We recommend using [IntelliJ IDEA](https://www.jetbrains.com/idea/download/) as the IDE. This
9497
has the best support for Kotlin, compiler plugins, Gradle, and [Kotlin Notebook](https://kotlinlang.org/docs/kotlin-notebook-overview.html) of course.
9598

build.gradle.kts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,10 @@ fun String.findVersion(): Version {
8989

9090
// these names of outdated dependencies will not show up in the table output
9191
val dependencyUpdateExclusions = listOf(
92-
// TODO Requires more work to be updated to 1.7.0+, https://github.com/Kotlin/dataframe/issues/594
93-
libs.plugins.kover.get().pluginId,
94-
// TODO 5.8.0 is not possible due to https://github.com/Kotlin/dataframe/issues/595
95-
libs.kotestAssertions.get().name,
96-
// Can't be updated to 7.4.0+ due to Java 8 compatibility
97-
libs.android.gradle.api.get().group,
9892
// Directly dependent on the Gradle version
9993
"org.gradle.kotlin.kotlin-dsl",
100-
// Can't be updated to 2.1.0+ due to Java 8 compatibility
101-
libs.plugins.simpleGit.get().pluginId,
94+
// need to revise our tests to update
95+
libs.android.gradle.api.get().group,
10296
)
10397

10498
// run `./gradlew dependencyUpdates` to check for updates
@@ -139,18 +133,25 @@ tasks.named<DependencyUpdatesTask>("dependencyUpdates").configure {
139133
}
140134
}
141135

142-
kotlin.jvmToolchain(11)
136+
kotlin {
137+
jvmToolchain(21)
138+
compilerOptions {
139+
jvmTarget = JvmTarget.JVM_11
140+
}
141+
}
143142

144143
allprojects {
145144
tasks.withType<KotlinCompile> {
146145
compilerOptions {
147146
jvmTarget = JvmTarget.JVM_11
147+
freeCompilerArgs.add("-Xjdk-release=11")
148148
}
149149
}
150150

151151
tasks.withType<JavaCompile> {
152152
sourceCompatibility = JavaVersion.VERSION_11.toString()
153153
targetCompatibility = JavaVersion.VERSION_11.toString()
154+
options.release.set(11)
154155
}
155156

156157
// Attempts to configure ktlint for each sub-project that uses the plugin
@@ -165,7 +166,7 @@ allprojects {
165166
}
166167

167168
// set the java toolchain version to 11 for all subprojects for CI stability
168-
extensions.findByType<KotlinJvmProjectExtension>()?.jvmToolchain(11)
169+
extensions.findByType<KotlinJvmProjectExtension>()?.jvmToolchain(21)
169170

170171
// Attempts to configure buildConfig for each sub-project that uses it
171172
try {

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/io/json.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ class JsonTests {
11211121
@Test
11221122
fun `serialize column with list of objects`() {
11231123
val df = dataFrameOf("col")(Regex(".+").findAll("abc").toList())
1124-
val json = shouldNotThrowAny { df.toJson() }
1124+
val json = shouldNotThrowAny { df.toJson() }!!
11251125
val list = DataFrame.readJsonStr(json)["col"][0].shouldBeInstanceOf<List<*>>()
11261126
list[0].shouldBeInstanceOf<String>()
11271127
}

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/statistics/BasicMathTests.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.jetbrains.kotlinx.dataframe.statistics
22

3+
import io.kotest.matchers.doubles.shouldBeNaN
34
import io.kotest.matchers.shouldBe
45
import org.jetbrains.kotlinx.dataframe.DataColumn
56
import org.jetbrains.kotlinx.dataframe.api.columnOf
@@ -18,10 +19,10 @@ class BasicMathTests {
1819

1920
@Test
2021
fun `mean with nans and nulls`() {
21-
columnOf(10, 20, Double.NaN, null).mean() shouldBe Double.NaN
22+
columnOf(10, 20, Double.NaN, null).mean().shouldBeNaN()
2223
columnOf(10, 20, Double.NaN, null).mean(skipNA = true) shouldBe 15
2324

24-
DataColumn.createValueColumn("", emptyList<Nothing>(), nothingType(false)).mean() shouldBe Double.NaN
25-
DataColumn.createValueColumn("", listOf(null), nothingType(true)).mean() shouldBe Double.NaN
25+
DataColumn.createValueColumn("", emptyList<Nothing>(), nothingType(false)).mean().shouldBeNaN()
26+
DataColumn.createValueColumn("", listOf(null), nothingType(true)).mean().shouldBeNaN()
2627
}
2728
}

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/statistics/std.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.jetbrains.kotlinx.dataframe.statistics
22

3+
import io.kotest.matchers.doubles.shouldBeNaN
34
import io.kotest.matchers.shouldBe
45
import org.jetbrains.kotlinx.dataframe.DataColumn
56
import org.jetbrains.kotlinx.dataframe.api.columnOf
@@ -59,10 +60,10 @@ class StdTests {
5960
val empty = DataColumn.createValueColumn("", emptyList<Nothing>(), nothingType(false))
6061
val nullable = DataColumn.createValueColumn("", listOf(null), nothingType(true))
6162

62-
empty.values().std(empty.type) shouldBe Double.NaN
63-
nullable.values().std(nullable.type) shouldBe Double.NaN
63+
empty.values().std(empty.type).shouldBeNaN()
64+
nullable.values().std(nullable.type).shouldBeNaN()
6465

65-
empty.std() shouldBe Double.NaN
66-
nullable.std() shouldBe Double.NaN
66+
empty.std().shouldBeNaN()
67+
nullable.std().shouldBeNaN()
6768
}
6869
}

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/testSets/animals/AnimalsTests.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.jetbrains.kotlinx.dataframe.testSets.animals
22

3+
import io.kotest.matchers.doubles.shouldBeNaN
34
import io.kotest.matchers.shouldBe
45
import org.jetbrains.kotlinx.dataframe.api.columnOf
56
import org.jetbrains.kotlinx.dataframe.api.dataFrameOf
@@ -42,7 +43,7 @@ class AnimalsTests {
4243
.update { age }.with { Double.NaN }
4344
.update { visits }.withNull()
4445
val mean = cleared.mean()
45-
mean[age] shouldBe Double.NaN
46-
(mean[visits.name()] as Double).isNaN() shouldBe true
46+
mean[age].shouldBeNaN()
47+
(mean[visits.name()] as Double).shouldBeNaN()
4748
}
4849
}

0 commit comments

Comments
 (0)