Skip to content

Commit fa9b058

Browse files
committed
Add missing files
1 parent 1abba13 commit fa9b058

File tree

4 files changed

+87
-0
lines changed

4 files changed

+87
-0
lines changed

build.sh

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/usr/bin/env bash
2+
set -o history -o histexpand
3+
4+
wait_for_docker() {
5+
6+
while [ -z ${docker_running+x} ]; do
7+
sleep 1
8+
{
9+
echo "Checking for running docker..."
10+
docker ps -q && docker_running=1
11+
} || {
12+
echo "Docker is not running. Please start docker on your computer"
13+
}
14+
done
15+
}
16+
17+
native() {
18+
echo "Building using docker graal"
19+
if [ -z "$(command -v docker)" ]; then
20+
echo "\"docker\" not found, please install docker"
21+
exit 1
22+
fi
23+
wait_for_docker
24+
docker run -it -v "$(pwd):/project" --rm richarddavison/graalvm-aws-linux2 --static "$@"
25+
}
26+
27+
native_arguments=("$@")
28+
index=$(echo "${native_arguments[@]/--args//}" | cut -d/ -f1 | wc -w | tr -d ' ')
29+
native_arguments=("${native_arguments[@]:$((index + 1))}")
30+
31+
if [[ $1 == "local" ]]; then
32+
33+
if [ -z ${GRAALVM_HOME+x} ]; then
34+
echo -e "evirontment variable GRAALVM_HOME is not set, try setting suing:\nexport GRAALVM_HOME=$HOME/Library/Graal/Contents/Home"
35+
exit 1
36+
fi
37+
38+
unset -f native
39+
native() {
40+
echo "Building using local graal"
41+
42+
export JAVA_HOME=${GRAALVM_HOME}
43+
export PATH=${JAVA_HOME}/bin:$PATH
44+
if [ -z "$(command -v native-image)" ]; then
45+
echo "\"native-image\" not found, installning native-image"
46+
gu install native-image
47+
fi
48+
native-image "$@"
49+
}
50+
fi
51+
52+
# shellcheck disable=SC2012
53+
native -jar "build/libs/$(ls -Slh ./build/libs | sed -n 2p | tr -s ' ' | cut -d ' ' -f9)" \
54+
--no-server \
55+
--enable-all-security-services \
56+
"${native_arguments[@]}"
57+
58+
exit_code=$?
59+
if [[ ${exit_code} -ne 0 ]]; then
60+
echo >&2 "Compilation failed with exit code ${exit_code}."
61+
exit "${exit_code}"
62+
fi
63+
64+
du -h runtime
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
[
3+
"java.util.List"
4+
],
5+
[
6+
"java.util.Map"
7+
]
8+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Args=-H:Name=runtime \
2+
-H:+ReportExceptionStackTraces \
3+
-H:ReflectionConfigurationResources=${.}/reflection-config.json \
4+
-H:DynamicProxyConfigurationResources=${.}/dynamic-proxy-config.json \
5+
-H:IncludeResources=META-INF/services/*.* \
6+
-H:EnableURLProtocols=http,https \
7+
-H:IncludeResourceBundles=javax.servlet.LocalStrings \
8+
-H:IncludeResourceBundles=javax.servlet.http.LocalStrings \
9+
-H:-UseServiceLoaderFeature \
10+
-H:+TraceServiceLoaderFeature \
11+
-H:+AddAllCharsets \
12+
--initialize-at-build-time=kotlin.jvm.internal.Intrinsics \
13+
--initialize-at-build-time=org.eclipse.jetty.util.thread.TryExecutor \
14+
--initialize-at-build-time=java.lang.invoke.MethodHandle
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

0 commit comments

Comments
 (0)