Bump Kotlin to version 2.1.20

This commit is contained in:
Erik C. Thauvin 2025-03-20 20:49:38 -07:00
parent 096e909dff
commit e048cab640
Signed by: erik
GPG key ID: 776702A6A2DA330E
2 changed files with 6 additions and 6 deletions

View file

@ -12,7 +12,7 @@ jobs:
strategy: strategy:
matrix: matrix:
java-version: [17, 21, 24] java-version: [17, 21, 24]
kotlin-version: [1.9.25, 2.1.10] kotlin-version: [1.9.25, 2.1.20]
steps: steps:
- name: Checkout source repository - name: Checkout source repository

View file

@ -7,6 +7,7 @@ import rife.bld.extension.DetektOperation;
import rife.bld.extension.DokkaOperation; import rife.bld.extension.DokkaOperation;
import rife.bld.extension.dokka.LoggingLevel; import rife.bld.extension.dokka.LoggingLevel;
import rife.bld.extension.dokka.OutputFormat; import rife.bld.extension.dokka.OutputFormat;
import rife.bld.extension.kotlin.CompileOptions;
import rife.bld.operations.exceptions.ExitStatusException; import rife.bld.operations.exceptions.ExitStatusException;
import java.io.File; import java.io.File;
@ -30,7 +31,7 @@ public class ExampleBuild extends Project {
autoDownloadPurge = true; autoDownloadPurge = true;
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES); 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) scope(compile)
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin)); .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin));
scope(test) scope(test)
@ -60,16 +61,15 @@ public class ExampleBuild extends Project {
@BuildCommand(summary = "Compiles the Kotlin project") @BuildCommand(summary = "Compiles the Kotlin project")
@Override @Override
public void compile() throws Exception { 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 // The source code located in src/main/kotlin and src/test/kotlin will be compiled
new CompileKotlinOperation() new CompileKotlinOperation()
.fromProject(this) .fromProject(this)
.compileOptions(options)
// .kotlinHome("path/to/kotlin") // .kotlinHome("path/to/kotlin")
// .kotlinc("path/to/kotlinc") // .kotlinc("path/to/kotlinc")
.execute(); .execute();
// var op = new CompileKotlinOperation().fromProject(this);
// op.compileOptions().verbose(true);
// op.execute();
} }
@BuildCommand(summary = "Checks source with Detekt") @BuildCommand(summary = "Checks source with Detekt")