Move jvmOptions to main compile operation

This commit is contained in:
Erik C. Thauvin 2025-03-23 02:18:31 -07:00
parent 3a012bf012
commit 125e9f7327
Signed by: erik
GPG key ID: 776702A6A2DA330E
6 changed files with 65 additions and 72 deletions

View file

@ -60,14 +60,17 @@ 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
new CompileKotlinOperation()
var op = new CompileKotlinOperation()
// .kotlinHome("path/to/kotlin")
// .kotlinc("path/to/kotlinc")
.compileOptions(options)
.fromProject(this)
.execute();
.compileOptions(new CompileOptions().verbose(true))
.fromProject(this);
if (!CompileKotlinOperation.isWindows()) {
op.jvmOptions().enableNativeAccess(JvmOptions.ALL_UNNAMED);
}
op.execute();
}
}