-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
compile
executable file
·44 lines (33 loc) · 1.04 KB
/
compile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
set -eo pipefail
if [ -z "$GRAALVM_HOME" ]; then
echo "Please set GRAALVM_HOME"
exit 1
fi
"$GRAALVM_HOME/bin/gu" install native-image || true
JET_VERSION=$(cat resources/JET_VERSION)
export PATH=$GRAALVM_HOME/bin:$PATH
export JAVA_HOME=$GRAALVM_HOME
lein with-profiles +native-image "do" clean, uberjar
BABASHKA_STATIC=${BABASHKA_STATIC:-}
BABASHKA_MUSL=${BABASHKA_MUSL:-}
args=("-jar" "target/jet-$JET_VERSION-standalone.jar"
"-H:+ReportExceptionStackTraces"
"--verbose"
"--no-fallback"
"--no-server"
"-J-Xmx3g"
"-J-Djet.native=true")
if [ "$BABASHKA_STATIC" = "true" ]; then
args+=("--static")
if [ "$BABASHKA_MUSL" = "true" ]; then
args+=("--libc=musl"
# see https://github.com/oracle/graal/issues/3398
"-H:CCompilerOption=-Wl,-z,stack-size=2097152")
else
# see https://github.com/oracle/graal/issues/3737
args+=("-H:+StaticExecutableWithDynamicLibC")
fi
fi
"$GRAALVM_HOME/bin/native-image" "${args[@]}"
lein clean