Add GraalVM native image
This commit is contained in:
parent
2bd6362268
commit
7a7ebe724e
@ -9,6 +9,14 @@ cd app/build/install/app-shadow
|
|||||||
|
|
||||||
Move the executable somewhere in your $PATH
|
Move the executable somewhere in your $PATH
|
||||||
|
|
||||||
|
Or build a native image with GraalVM
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./gradlew installShadowDist
|
||||||
|
cd app/build/install/app-shadow/lib
|
||||||
|
native-image --no-fallback -R:MaxNewSize=32 -jar scaffold.jar
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Create a generator
|
### Create a generator
|
||||||
|
|||||||
5
app/resources/META-INF/native-image/reflect-config.json
Normal file
5
app/resources/META-INF/native-image/reflect-config.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name":"com.electronwill.nightconfig.toml.TomlFormat"
|
||||||
|
}
|
||||||
|
]
|
||||||
5
app/resources/META-INF/native-image/resource-config.json
Normal file
5
app/resources/META-INF/native-image/resource-config.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"resources":{
|
||||||
|
"includes":[{"pattern":"\\QMETA-INF/services/org.slf4j.spi.SLF4JServiceProvider\\E"}]},
|
||||||
|
"bundles":[]
|
||||||
|
}
|
||||||
@ -12,8 +12,8 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
targetCompatibility = JavaVersion.toVersion(15)
|
targetCompatibility = JavaVersion.toVersion(11)
|
||||||
sourceCompatibility = JavaVersion.toVersion(15)
|
sourceCompatibility = JavaVersion.toVersion(11)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<JavaCompile> {
|
tasks.withType<JavaCompile> {
|
||||||
|
|||||||
@ -17,7 +17,7 @@ tasks.withType<Test> {
|
|||||||
|
|
||||||
tasks.withType<KotlinCompile> {
|
tasks.withType<KotlinCompile> {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "15"
|
jvmTarget = "11"
|
||||||
javaParameters = true
|
javaParameters = true
|
||||||
freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn")
|
freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn")
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user