-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild-native.sh
executable file
·51 lines (40 loc) · 1.24 KB
/
build-native.sh
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
45
46
47
48
49
50
51
#!/usr/bin/env bash
##
## Configuration
##
# Requires: Defined GRAAL_HOME to point at the root of your GRAALVM folder.
# Requires: Leiningen
# Set GRAAL VM to JAVA_HOME
export JAVA_HOME=$GRAAL_HOME
# Add GRAAL VM to the PATH, should include native-image
export PATH=$GRAAL_HOME/bin:$PATH
# Lein Command Override
LEIN_CMD=lein
# Retrieve the current eden version
echo "Getting Project Version..."
EDEN_VERSION=`$LEIN_CMD project-version`
echo "Project Version: " $EDEN_VERSION
echo ""
echo "Generating Uberjar..."
$LEIN_CMD uberjar
echo ""
echo "Building Native Image..."
native-image -jar target/eden-$EDEN_VERSION-standalone.jar \
-H:Name="eden-${EDEN_VERSION}" \
--initialize-at-build-time \
--no-server \
--no-fallback \
--report-unsupported-elements-at-runtime \
-H:EnableURLProtocols=http,https \
--enable-all-security-services \
-H:+ReportExceptionStackTraces \
-H:ReflectionConfigurationFiles=ReflectionConfig.json
echo ""
echo "Post Configuration..."
mkdir -p bin
chmod 744 eden-${EDEN_VERSION}
mv eden-$EDEN_VERSION ./bin/
rm -f ./bin/eden
ln -s ./bin/eden-$EDEN_VERSION ./bin/eden
echo ""
echo "Built executable can be found at ./bin/eden-${EDEN_VERSION}"