51 lines
1.4 KiB
Bash
Executable file
51 lines
1.4 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -eo pipefail
|
|
|
|
if [ -z "$GRAALVM_HOME" ]; then
|
|
echo "Please set GRAALVM_HOME"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$BABASHKA_XMX" ]; then
|
|
export BABASHKA_XMX="-J-Xmx3g"
|
|
fi
|
|
|
|
"$GRAALVM_HOME/bin/gu" install native-image || true
|
|
|
|
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
|
|
|
|
export JAVA_HOME=$GRAALVM_HOME
|
|
|
|
$GRAALVM_HOME/bin/javac -cp $GRAALVM_HOME/jre/lib/svm/builder/svm.jar resources/CutOffCoreServicesDependencies.java
|
|
|
|
lein with-profiles +reflection do run
|
|
lein do clean, uberjar
|
|
|
|
args=( -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: \
|
|
-H:EnableURLProtocols=http,https \
|
|
--enable-all-security-services \
|
|
-H:+JNI \
|
|
--verbose \
|
|
--no-fallback \
|
|
--no-server \
|
|
--report-unsupported-elements-at-runtime \
|
|
"$BABASHKA_XMX" )
|
|
|
|
if [ "$BABASHKA_STATIC" = "true" ]; then
|
|
args+=("--static")
|
|
fi
|
|
|
|
$GRAALVM_HOME/bin/native-image "${args[@]}"
|
|
|
|
lein clean
|