From e048cab640766964b2127625e3da9b5d00322ac3 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 20 Mar 2025 20:49:38 -0700 Subject: [PATCH] Bump Kotlin to version 2.1.20 --- .github/workflows/bld.yml | 2 +- src/bld/java/com/example/ExampleBuild.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml index 0ba897e..bdd3185 100644 --- a/.github/workflows/bld.yml +++ b/.github/workflows/bld.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: java-version: [17, 21, 24] - kotlin-version: [1.9.25, 2.1.10] + kotlin-version: [1.9.25, 2.1.20] steps: - name: Checkout source repository diff --git a/src/bld/java/com/example/ExampleBuild.java b/src/bld/java/com/example/ExampleBuild.java index 980a36e..85b7a49 100644 --- a/src/bld/java/com/example/ExampleBuild.java +++ b/src/bld/java/com/example/ExampleBuild.java @@ -7,6 +7,7 @@ import rife.bld.extension.DetektOperation; import rife.bld.extension.DokkaOperation; import rife.bld.extension.dokka.LoggingLevel; import rife.bld.extension.dokka.OutputFormat; +import rife.bld.extension.kotlin.CompileOptions; import rife.bld.operations.exceptions.ExitStatusException; import java.io.File; @@ -30,7 +31,7 @@ public class ExampleBuild extends Project { autoDownloadPurge = true; repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES); - final var kotlin = version(2, 1, 10); + final var kotlin = version(2, 1, 20); scope(compile) .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin)); scope(test) @@ -60,16 +61,15 @@ public class ExampleBuild extends Project { @BuildCommand(summary = "Compiles the Kotlin project") @Override public void compile() throws Exception { + // Avoid warnings in JDK 24 + final var options = new CompileOptions().jvmOptions("--enable-native-access=ALL-UNNAMED"); // The source code located in src/main/kotlin and src/test/kotlin will be compiled new CompileKotlinOperation() .fromProject(this) + .compileOptions(options) // .kotlinHome("path/to/kotlin") // .kotlinc("path/to/kotlinc") .execute(); - -// var op = new CompileKotlinOperation().fromProject(this); -// op.compileOptions().verbose(true); -// op.execute(); } @BuildCommand(summary = "Checks source with Detekt")