Implement JvmOptions class

This commit is contained in:
Erik C. Thauvin 2025-03-21 00:58:41 -07:00
parent 832447771d
commit 3c5b1fde8f
Signed by: erik
GPG key ID: 776702A6A2DA330E
6 changed files with 140 additions and 10 deletions

View file

@ -1,7 +1,7 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.downloadLocation=
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.4
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.5-SNAPSHOT
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories=
bld.version=2.2.1

View file

@ -3,6 +3,8 @@ package com.example;
import rife.bld.BuildCommand;
import rife.bld.Project;
import rife.bld.extension.CompileKotlinOperation;
import rife.bld.extension.kotlin.CompileOptions;
import rife.bld.extension.kotlin.JvmOptions;
import java.io.File;
import java.util.List;
@ -58,12 +60,14 @@ public class ExampleBuild extends Project {
@BuildCommand(summary = "Compiles the Kotlin project")
@Override
public void compile() throws Exception {
var options = new CompileOptions().verbose(true);
options.jvmOptions().enableNativeAccess(JvmOptions.ALL_UNNAMED);
// The source code located in src/main/kotlin and src/test/kotlin will be compiled
var op = new CompileKotlinOperation()
new CompileKotlinOperation()
// .kotlinHome("path/to/kotlin")
// .kotlinc("path/to/kotlinc")
.fromProject(this);
op.compileOptions().verbose(true);
op.execute();
.compileOptions(options)
.fromProject(this)
.execute();
}
}