-
Notifications
You must be signed in to change notification settings - Fork 2
/
build-native-image
executable file
·36 lines (33 loc) · 1.34 KB
/
build-native-image
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
#!/bin/sh
root_path=${PWD}
name=$(lein print :name | sed 's|"||g')
version=$(lein print :version | sed 's|"||g')
# --initialize-at-run-time=org.postgresql.sspi.SSPIClient
# --initialize-at-run-time=java.lang.Math\$RandomNumberGeneratorHolder \
# -J-Dclojure.compiler.direct-linking=true \
# -J-Dclojure.spec.skip-macros=true \
# -J-Xmx4G \
# "-H:ReflectionConfigurationFiles=META-INF/native-image/reflect-config.json" \
# "-H:JNIConfigurationFiles=META-INF/native-image/jni-config.json" \
#-H:+JNI \
#--initialize-at-build-time \
#--enable-all-security-services \
#--initialize-at-run-time=java.lang.Math\$RandomNumberGeneratorHolder \
#-J-Dclojure.compiler.direct-linking=true \
#-J-Dclojure.spec.skip-macros=true \
#-J-Xmx4G
native-image \
-H:Name="${name}" \
-H:+ReportExceptionStackTraces \
-H:+JNI \
--enable-url-protocols=file,https,http \
--report-unsupported-elements-at-runtime \
--no-server \
--static \
--verbose \
--no-fallback \
--configurations-path ${root_path}/META-INF/native-image \
--features=clj_easy.graal_build_time.InitClojureClasses \
-jar target/uberjar/${name}-${version}-standalone.jar \
--add-exports jdk.internal.vm.ci/jdk.vm.ci.services=ALL-UNNAMED \
--add-exports jdk.internal.vm.compiler/org.graalvm.compiler.options=ALL-UNNAMED