Include relevant resources for native-image generation (#262)

This commit is contained in:
Marcin Kostrzewa 2019-10-28 12:46:24 +01:00 committed by Ara Adkins
parent 698a9425ab
commit c646be4820
2 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,3 @@
@{
print: 0;
0
@println [@IO,0]
}

View File

@ -252,11 +252,12 @@ lazy val interpreter = (project in file("Interpreter"))
.settings(
buildNativeImage := Def
.task {
val javaHome = System.getProperty("java.home")
val nativeImagePath = s"$javaHome/bin/native-image"
val classPath = (Runtime / fullClasspath).value.files.mkString(":")
val javaHome = System.getProperty("java.home")
val nativeImagePath = s"$javaHome/bin/native-image"
val classPath = (Runtime / fullClasspath).value.files.mkString(":")
val resourcesGlobOpt = "-H:IncludeResources=.*Main.enso$"
val cmd =
s"$nativeImagePath --macro:truffle --no-fallback --initialize-at-build-time -cp $classPath ${(Compile / mainClass).value.get} enso"
s"$nativeImagePath $resourcesGlobOpt --macro:truffle --no-fallback --initialize-at-build-time -cp $classPath ${(Compile / mainClass).value.get} enso"
cmd !
}
.dependsOn(Compile / compile)