2
0
Fork 0
mirror of https://github.com/ethauvin/rife2-hello.git synced 2025-04-25 15:37:10 -07:00

Merge pull request #7 from melix/cc/use-official-graalvm-plugin

Use the official GraalVM plugin
This commit is contained in:
Geert Bevin 2023-03-05 10:39:39 -05:00 committed by GitHub
commit 83e52c0e06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 8 deletions

View file

@ -92,18 +92,23 @@ GraalVM supports creating a single Ahead-Of-Time
[native executable](https://www.graalvm.org/native-image/) from your java
bytecode.
Once you have at least GraalVM 22.3.1 Java 19 installed, you can generate the
UberJar as above, then create your native binary as such:
Once you have at least GraalVM 22.3.1 Java 17 installed, you can generate the native binary with:
```bash
native-image --no-fallback --enable-preview -jar app/build/libs/hello-uber-1.0.jar
./gradlew nativeCompile
```
You'll end up with a `hello-uber-1.0` file that can be executed directly without
You'll end up with a `hello-1.0` file that can be executed directly without
the need of a JVM:
```bash
./hello-uber-1.0
./app/build/native/nativeCompile/hello-1.0
```
Alternatively, you can run the native executable directly with:
```bash
./gradlew nativeRun
```
> **NOTE:** RIFE2 support for GraalVM native-image is still in preliminary

View file

@ -6,6 +6,7 @@ plugins {
application
id("com.uwyn.rife2")
`maven-publish`
id("org.graalvm.buildtools.native") version "0.9.20"
}
base {
@ -68,3 +69,7 @@ publishing {
}
}
}
graalvmNative.binaries.all {
imageName.set("hello-$version")
}

View file

@ -2,5 +2,9 @@
{
"name":"rife.template.html.hello",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"rife.template.html.world",
"methods":[{"name":"<init>","parameterTypes":[] }]
}
]

View file

@ -1,4 +1,8 @@
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
includeBuild("build-logic")
}