babashka/script/compile
Michiel Borkent a0cd0b58d8
v0.0.7
2019-08-14 00:19:15 +02:00

30 lines
816 B
Bash
Executable file

#!/usr/bin/env bash
if [ -z "$GRAALVM_HOME" ]; then
echo "Please set GRAALVM_HOME"
exit 1
fi
"$GRAALVM_HOME/bin/gu" install native-image
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
lein with-profiles +clojure-1.10.1 do clean, uberjar
$GRAALVM_HOME/bin/native-image \
-jar target/babashka-$BABASHKA_VERSION-standalone.jar \
-H:Name=bb \
-H:+ReportExceptionStackTraces \
-J-Dclojure.spec.skip-macros=true \
-J-Dclojure.compiler.direct-linking=true \
"-H:IncludeResources=BABASHKA_VERSION" \
"-H:IncludeResources=SCI_VERSION" \
-H:ReflectionConfigurationFiles=reflection.json \
--initialize-at-run-time=java.lang.Math\$RandomNumberGeneratorHolder \
--initialize-at-build-time \
-H:Log=registerResource: \
--verbose \
--no-fallback \
--no-server \
"-J-Xmx3g"
lein clean