Improve configuration and tests for native-image (#509)

* Don't expose JDK internal classes; instead solve msgpack issue with `--initialize-at-run-time`.
* Use quick build mode for non-release builds:  40% faster compilation, 20% smaller executable.
* Remove options that were commented out.
* Also run ServerTest against native executable
This commit is contained in:
Daniel Chao
2024-06-03 17:08:30 -07:00
committed by GitHub
parent a48748cb9c
commit d81a12352c
11 changed files with 232 additions and 170 deletions
+21 -2
View File
@@ -2,6 +2,7 @@ plugins {
pklAllProjects
pklJavaLibrary
pklKotlinLibrary
pklNativeBuild
}
dependencies {
@@ -14,6 +15,24 @@ dependencies {
}
tasks.test {
inputs.dir("src/test/files/SnippetTests/input").withPropertyName("snippetTestsInput").withPathSensitivity(PathSensitivity.RELATIVE)
inputs.dir("src/test/files/SnippetTests/output").withPropertyName("snippetTestsOutput").withPathSensitivity(PathSensitivity.RELATIVE)
inputs.dir("src/test/files/SnippetTests/input")
.withPropertyName("snippetTestsInput")
.withPathSensitivity(PathSensitivity.RELATIVE)
inputs.dir("src/test/files/SnippetTests/output")
.withPropertyName("snippetTestsOutput")
.withPathSensitivity(PathSensitivity.RELATIVE)
exclude("**/NativeServerTest.*")
}
val nativeTest by tasks.registering(Test::class) {
dependsOn(":pkl-cli:assembleNative")
testClassesDirs = files(tasks.test.get().testClassesDirs)
classpath = tasks.test.get().classpath
include("**/NativeServerTest.*")
}
val testNative by tasks.existing
testNative {
dependsOn(nativeTest)
}