-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompile.sh
executable file
·47 lines (38 loc) · 1.37 KB
/
compile.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
#!/usr/bin/env bash
ARTIFACT=logback
MAINCLASS=com.example.logback.LogbackApplication
VERSION=0.0.1-SNAPSHOT
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'
rm -rf build
mkdir -p build/native-image
echo "Packaging $ARTIFACT with Gradle"
./gradlew build
JAR="$ARTIFACT-$VERSION.war"
rm -f $ARTIFACT
echo "Unpacking $JAR"
cd build/native-image
jar -xvf ../libs/$JAR >/dev/null 2>&1
cp -R META-INF WEB-INF/classes
# To run tracing agent
# java -cp WEB-INF/classes:WEB-INF/lib/*:WEB-INF/lib-provided/* -agentlib:native-image-agent=config-output-dir=../graal-agent com.vue.labs.LocalAbeServiceApplication
LIBPATH=`find WEB-INF/lib | tr '\n' ':'`
CP=WEB-INF/classes:$LIBPATH
GRAALVM_VERSION=`native-image --version`
echo "Compiling $ARTIFACT with $GRAALVM_VERSION"
native-image \
--no-server \
--no-fallback \
--enable-all-security-services \
--verbose \
-H:Name=$ARTIFACT \
-H:+RemoveSaturatedTypeFlows \
-H:+ReportExceptionStackTraces \
-H:+PrintClassInitialization \
-Dspring.native.remove-yaml-support=true \
-Dspring.xml.ignore=false \
-cp $CP $MAINCLASS >> output.txt
# --rerun-class-initialization-at-runtime=org.bouncycastle.jcajce.provider.drbg.DRBG$Default,org.bouncycastle.jcajce.provider.drbg.DRBG$NonceAndIV \
# --trace-class-initialization=org.bouncycastle.jcajce.provider.drbg.DRBG \
# --initialize-at-run-time=org.bouncycastle.jcajce.provider.drbg.DRBG \