forked from StarOpenSource/Engine
Fix native-image a bit
This commit is contained in:
parent
d02e854d95
commit
005ebfbfae
1 changed files with 27 additions and 11 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue