From 005ebfbfae76d2ae41758966e8708beac67baff8 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Thu, 11 Jul 2024 16:15:47 +0200 Subject: [PATCH] Fix native-image a bit --- testapp/build.gradle | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/testapp/build.gradle b/testapp/build.gradle index e1cb4b7b..5ebee838 100644 --- a/testapp/build.gradle +++ b/testapp/build.gradle @@ -17,6 +17,8 @@ * along with this program. If not, see . */ +import org.mikeneck.graalvm.BuildTypeSelector + // Plugins plugins { id("java") @@ -87,26 +89,40 @@ application { // GraalVM native-image plugin configuration nativeImage { + outputs.upToDateWhen { true } + 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") + setClasspath(shadowJar) + buildType { BuildTypeSelector build -> + build.executable { + main = 'de.staropensource.sosengine.testapp.Main' + } + } arguments { - "--color=always" - "-march native" - "-O3" - "--gc=g1" - "--no-fallback" - "--enable-all-security-services" - "--report-unsupported-elements-at-runtime" - //"-H:IncludeResources=.*properties\$" + add "-H:+UnlockExperimentalVMOptions" + add "--color=always" + add "-march=native" + add "-O3" + add "--no-fallback" + add "--report-unsupported-elements-at-runtime" + add "--enable-http" + add "--enable-https" + add "-H:IncludeResources=.*properties\$" } } // Register task for executing the generated binary -tasks.register('runNativeimage', Exec) { +tasks.register('runNativeImage', Exec) { + outputs.upToDateWhen { false } dependsOn(nativeImage) + + args( + "-Dsosengine.base.loggerLevel=diagnostic", + "-Dsosengine.base.loggerForceStandardOutput=true", + "-Djansi.mode=force" + ) executable("build/bin/sosengine-testapp") - args = application.applicationDefaultJvmArgs }