From 0e28d746bd37f9d3eeb51ea614fcc91da294cfe9 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Mon, 8 Jul 2024 15:40:11 +0200 Subject: [PATCH] Add GraalVM native-image tasks --- .idea/workspace.xml | 53 ++++++++++++++++++++++++++++++++++++++++---- testapp/build.gradle | 19 ++++++++++++++++ 2 files changed, 68 insertions(+), 4 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index bfc6d56..58f42f5 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,6 +1,28 @@ + + + + + + true + true + false + false + + + + + + + + true + true + false + false + + + + + + - - diff --git a/testapp/build.gradle b/testapp/build.gradle index d00d432..bffba78 100644 --- a/testapp/build.gradle +++ b/testapp/build.gradle @@ -22,6 +22,7 @@ plugins { id "application" id("io.freefair.lombok") version("${pluginLombok}") id("io.github.goooler.shadow") version("${pluginShadow}") + id('org.mikeneck.graalvm-native-image') version('v1.4.0') } dependencies { @@ -73,3 +74,21 @@ application { "-Djansi.mode=force", ] } + +nativeImage { + graalVmHome = project.hasProperty("graalHome") ? project.property("graalHome") as String : System.getProperty("java.home") + mainClass = "de.staropensource.sosengine.testapp.Main" + executableName = "sosengine-testapp" + outputDirectory = file("build/bin") + arguments { + "--no-fallback" + "--enable-all-security-services" + "--report-unsupported-elements-at-runtime" + } +} + +tasks.register('runNativeimage', Exec) { + dependsOn(nativeImage) + executable("build/bin/sosengine-testapp") + args = application.applicationDefaultJvmArgs +}