Add Kotlin example compile options for JDK 24

This commit is contained in:
Erik C. Thauvin 2025-03-20 21:36:17 -07:00
parent 6510b2b6b3
commit 3cac9171fd
Signed by: erik
GPG key ID: 776702A6A2DA330E
2 changed files with 5 additions and 2 deletions

View file

@ -3,6 +3,7 @@ package net.thauvin.erik.pinboard.samples;
import rife.bld.BaseProject; import rife.bld.BaseProject;
import rife.bld.BuildCommand; import rife.bld.BuildCommand;
import rife.bld.extension.CompileKotlinOperation; import rife.bld.extension.CompileKotlinOperation;
import rife.bld.extension.kotlin.CompileOptions;
import rife.bld.operations.RunOperation; import rife.bld.operations.RunOperation;
import java.util.List; import java.util.List;
@ -25,7 +26,7 @@ public class ExampleBuild extends BaseProject {
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY); repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY);
scope(compile) scope(compile)
.include(dependency("net.thauvin.erik", "pinboard-poster", version(1, 2, 0))); .include(dependency("net.thauvin.erik", "pinboard-poster", version(1, 2, 1, "SNAPSHOT")));
} }
public static void main(String[] args) { public static void main(String[] args) {
@ -34,8 +35,10 @@ public class ExampleBuild extends BaseProject {
@Override @Override
public void compile() throws Exception { public void compile() throws Exception {
var options = new CompileOptions().jvmOptions("--enable-native-access=ALL-UNNAMED");
new CompileKotlinOperation() new CompileKotlinOperation()
.fromProject(this) .fromProject(this)
.compileOptions(options)
.execute(); .execute();
// Also compile the Java source code // Also compile the Java source code

View file

@ -125,7 +125,7 @@ public class PinboardPosterBuild 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 {
final var options = new CompileOptions().jvmOptions("--enable-native-access=ALL-UNNAMED"); var options = new CompileOptions().jvmOptions("--enable-native-access=ALL-UNNAMED");
new CompileKotlinOperation() new CompileKotlinOperation()
.fromProject(this) .fromProject(this)
.compileOptions(options) .compileOptions(options)