1 | #!/usr/bin/env bash |
---|
2 | DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
---|
3 | |
---|
4 | jdk=$1 |
---|
5 | if [[ -z $jdk ]]; then |
---|
6 | jdk=openjdk8 |
---|
7 | fi |
---|
8 | |
---|
9 | root="${DIR}/.." |
---|
10 | prop_in="${root}/abcl.properties.in" |
---|
11 | prop_out="${root}/abcl.properties" |
---|
12 | echo "Configuring for $jdk from <${prop_in}>." |
---|
13 | |
---|
14 | # Unused |
---|
15 | # zgc="-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xmx<size> -Xlog:gc" |
---|
16 | opens="--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" |
---|
17 | |
---|
18 | abcl_javac_source=1.8 |
---|
19 | case $jdk in |
---|
20 | 6|openjdk6) |
---|
21 | options="-d64 -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=1g -XX:+UseConcMarkSweepGC" |
---|
22 | ant_build_javac_target=1.6 |
---|
23 | ant_build_javac_source=1.6 |
---|
24 | ;; |
---|
25 | 7|openjdk7) |
---|
26 | options="-d64 -XX:+UseG1GC" |
---|
27 | ant_build_javac_target=1.7 |
---|
28 | ant_build_javac_source=1.7 |
---|
29 | ;; |
---|
30 | 8|openjdk8) |
---|
31 | options="-XX:+UseG1GC -XX:+AggressiveOpts -XX:CompileThreshold=10" |
---|
32 | ant_build_javac_target=1.8 |
---|
33 | ant_build_javac_source=1.8 |
---|
34 | ;; |
---|
35 | 11|openjdk11) |
---|
36 | options="-XX:CompileThreshold=10" |
---|
37 | ant_build_javac_target=11 |
---|
38 | ant_build_javac_source=1.8 |
---|
39 | ;; |
---|
40 | # untested: weakly unsupported |
---|
41 | 12|openjdk12) |
---|
42 | options="-XX:CompileThreshold=10" |
---|
43 | ant_build_javac_target=12 |
---|
44 | ant_build_javac_source=1.8 |
---|
45 | ;; |
---|
46 | 13|openjdk13) |
---|
47 | options="-XX:CompileThreshold=10" |
---|
48 | ant_build_javac_target=13 |
---|
49 | ant_build_javac_source=1.8 |
---|
50 | ;; |
---|
51 | 14|openjdk14) |
---|
52 | options="-XX:CompileThreshold=10 ${zgc}" |
---|
53 | ant_build_javac_target=14 |
---|
54 | ant_build_javac_source=1.8 |
---|
55 | ;; |
---|
56 | 15|openjdk15) |
---|
57 | options="-XX:CompileThreshold=10 ${zgc}" |
---|
58 | ant_build_javac_target=15 |
---|
59 | ant_build_javac_source=1.8 |
---|
60 | ;; |
---|
61 | 16|openjdk16) |
---|
62 | options="-XX:CompileThreshold=10 ${zgc}" |
---|
63 | ant_build_javac_target=16 |
---|
64 | ant_build_javac_source=1.8 |
---|
65 | ;; |
---|
66 | 17|openjdk17) |
---|
67 | options="-XX:CompileThreshold=10 ${opens}" |
---|
68 | ant_build_javac_target=17 |
---|
69 | ant_build_javac_source=1.8 |
---|
70 | ;; |
---|
71 | 18|openjdk18) |
---|
72 | options="-XX:CompileThreshold=10 ${opens}" |
---|
73 | ant_build_javac_target=18 |
---|
74 | ant_build_javac_source=1.8 |
---|
75 | ;; |
---|
76 | 19:openjdk19) |
---|
77 | options="-XX:CompileThreshold=10 ${opens}" |
---|
78 | ant_build_javac_target=19 |
---|
79 | ant_build_javac_source=1.8 |
---|
80 | ;; |
---|
81 | *) |
---|
82 | options="-XX:CompileThreshold=10 ${opens}" |
---|
83 | ant_build_javac_target=19 |
---|
84 | ant_build_javac_source=1.8 |
---|
85 | ;; |
---|
86 | esac |
---|
87 | |
---|
88 | cat ${root}/abcl.properties.in \ |
---|
89 | | awk -F = \ |
---|
90 | -v options="$options" \ |
---|
91 | -v source="$ant_build_javac_source" \ |
---|
92 | -f ${DIR}/create-abcl-properties.awk \ |
---|
93 | > ${root}/abcl.properties |
---|
94 | |
---|
95 | |
---|
96 | # cat ${root}/abcl.properties.in \ |
---|
97 | # | awk -F = \ |
---|
98 | # -v options="$options" \ |
---|
99 | # -v target="$ant_build_javac_target" \ |
---|
100 | # -v source="$ant_build_javac_source" \ |
---|
101 | # -f ${DIR}/create-abcl-properties.awk \ |
---|
102 | # > ${root}/abcl.properties |
---|
103 | |
---|
104 | echo "Finished configuring for $jdk into <${prop_out}>." |
---|