mirror of
https://github.com/ethauvin/rife2-hello.git
synced 2025-04-25 23:37:12 -07:00
Use the official GraalVM plugin
This commit is contained in:
parent
5ca1fa305b
commit
a79e616d79
4 changed files with 26 additions and 8 deletions
15
README.md
15
README.md
|
@ -92,18 +92,23 @@ GraalVM supports creating a single Ahead-Of-Time
|
||||||
[native executable](https://www.graalvm.org/native-image/) from your java
|
[native executable](https://www.graalvm.org/native-image/) from your java
|
||||||
bytecode.
|
bytecode.
|
||||||
|
|
||||||
Once you have at least GraalVM 22.3.1 Java 19 installed, you can generate the
|
Once you have at least GraalVM 22.3.1 Java 17 installed, you can generate the native binary with:
|
||||||
UberJar as above, then create your native binary as such:
|
|
||||||
|
|
||||||
```bash
|
```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:
|
the need of a JVM:
|
||||||
|
|
||||||
```bash
|
```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
|
> **NOTE:** RIFE2 support for GraalVM native-image is still in preliminary
|
||||||
|
|
|
@ -6,6 +6,7 @@ plugins {
|
||||||
application
|
application
|
||||||
id("com.uwyn.rife2")
|
id("com.uwyn.rife2")
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
|
id("org.graalvm.buildtools.native") version "0.9.20"
|
||||||
}
|
}
|
||||||
|
|
||||||
base {
|
base {
|
||||||
|
@ -66,3 +67,7 @@ publishing {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
graalvmNative.binaries.all {
|
||||||
|
imageName.set("hello-$version")
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name":"rife.template.html.hello",
|
"name":"rife.template.html.hello",
|
||||||
|
"methods":[{"name":"<init>","parameterTypes":[] }]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"rife.template.html.world",
|
||||||
"methods":[{"name":"<init>","parameterTypes":[] }]
|
"methods":[{"name":"<init>","parameterTypes":[] }]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
pluginManagement {
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
gradlePluginPortal()
|
||||||
|
}
|
||||||
includeBuild("build-logic")
|
includeBuild("build-logic")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue