Fix native-image a bit

This commit is contained in:
JeremyStar™ 2024-07-11 16:15:47 +02:00
parent d02e854d95
commit 005ebfbfae
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -17,6 +17,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
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
}