Skip to content

Commit 6a76b28

Browse files
committed
Kotlin 2.0 + various other upgrades
1 parent 98ed21b commit 6a76b28

File tree

9 files changed

+29
-34
lines changed

9 files changed

+29
-34
lines changed

build.gradle.kts

+7-5
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@ import com.adarshr.gradle.testlogger.theme.ThemeType.MOCHA_PARALLEL
33
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
44
import io.codearte.gradle.nexus.NexusStagingExtension
55
import org.gradle.api.JavaVersion.VERSION_17
6+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
7+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0
68
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
79
import org.jmailen.gradle.kotlinter.KotlinterExtension
810
import kotlin.text.RegexOption.IGNORE_CASE
911

1012
plugins {
1113
kotlin("jvm") apply false
1214
id("io.codearte.nexus-staging") version "0.30.0"
13-
id("org.jmailen.kotlinter") version "4.4.0" apply false
15+
id("org.jmailen.kotlinter") version "4.4.1" apply false
1416
id("com.adarshr.test-logger") version "4.0.0" apply false
1517
id("com.github.ben-manes.versions") version "0.51.0"
1618
id("org.jetbrains.dokka")
17-
id("org.jetbrains.kotlinx.kover") version "0.8.1"
19+
id("org.jetbrains.kotlinx.kover") version "0.8.3"
1820
}
1921

2022
repositories {
@@ -53,9 +55,9 @@ subprojects {
5355
}
5456

5557
tasks.withType<KotlinCompile> {
56-
kotlinOptions {
57-
jvmTarget = VERSION_17.toString()
58-
languageVersion = "1.9"
58+
compilerOptions {
59+
jvmTarget.set(JVM_17)
60+
languageVersion.set(KOTLIN_2_0)
5961
javaParameters = true
6062
freeCompilerArgs = listOf("-Xjvm-default=all")
6163
allWarningsAsErrors = true

gradle.properties

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m
55
versions.arrow=1.2.4
66
versions.failgood=0.9.1
77
versions.filepeek=0.1.3
8-
versions.jackson=2.17.1
9-
versions.junit=5.10.2
10-
versions.kotlin=1.9.20
8+
versions.jackson=2.17.2
9+
versions.junit=5.10.3
10+
versions.kotlin=2.0.10
1111
versions.kotlinx-coroutines=1.8.1
1212
versions.minutest=1.13.0
13-
versions.mockk=1.13.11
14-
versions.protobuf=4.27.1
13+
versions.mockk=1.13.12
14+
versions.protobuf=4.27.3
1515
versions.opentest4j=1.3.0
16-
versions.spring-boot=3.3.1
16+
versions.spring-boot=3.3.2

gradle/wrapper/gradle-wrapper.jar

-19.8 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.

gradlew.bat

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
4343
%JAVA_EXE% -version >NUL 2>&1
4444
if %ERRORLEVEL% equ 0 goto execute
4545

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
46+
echo. 1>&2
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48+
echo. 1>&2
49+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50+
echo location of your Java installation. 1>&2
5151

5252
goto fail
5353

@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5757

5858
if exist "%JAVA_EXE%" goto execute
5959

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6565

6666
goto fail
6767

strikt-core/src/test/kotlin/strikt/Chained.kt

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ internal class Chained {
7575
.isEqualTo(expected)
7676
}
7777

78+
@Suppress("RedundantNullableReturnType")
7879
@Test
7980
fun `can connect a block to a chain with and`() {
8081
val error =

strikt-core/src/test/kotlin/strikt/docs/Homepage.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ internal class Homepage {
5656
@Test
5757
fun `homepage four`() {
5858
// START homepage_four
59-
val subject = Deity.values().map { it.toString() }
59+
val subject = Deity.entries.map { it.toString() }
6060
expectThat(subject)
6161
.isNotEmpty()
6262
.any { startsWith("E") }
@@ -104,7 +104,7 @@ internal class Homepage {
104104
// END homepage_seven
105105
}
106106

107-
@Suppress("ktlint:standard:no-multi-spaces")
107+
@Suppress("ktlint:standard:no-multi-spaces", "RedundantNullableReturnType")
108108
@Test
109109
fun `homepage eight`() {
110110
// START homepage_eight

strikt-protobuf/strikt-protobuf.gradle.kts

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@file:Suppress("KDocMissingDocumentation")
22

33
import org.jetbrains.dokka.gradle.DokkaTaskPartial
4-
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
54
import java.net.URL
65

76
plugins {
@@ -41,18 +40,11 @@ protobuf {
4140
}
4241
}
4342

44-
// This seems to be necessary just to get IntelliJ to notice the proto sources.
45-
// It works fine from the terminal without this. Also IntelliJ picks up main
46-
// protos just fine.
47-
48-
val SourceSet.kotlin
49-
get() = withConvention(KotlinSourceSet::class) { kotlin }
50-
5143
sourceSets {
5244
getByName("test") {
5345
kotlin.srcDirs(
5446
"src/test/kotlin",
55-
"$buildDir/generated/source/proto/test/java"
47+
"$buildFile/generated/source/proto/test/java"
5648
)
5749
}
5850
}

0 commit comments

Comments
 (0)