Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: improvements for openjdk21 and beyond #670

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,22 @@ JVM System Properties
</exec>
</target>

<target name="abcl.properties.autoconfigure.openjdk.21">
<exec executable="/usr/bin/env">
<arg value="bash"/>
<arg value="ci/create-abcl-properties.bash"/>
<arg value="openjdk21"/>
</exec>
</target>

<target name="abcl.properties.autoconfigure.openjdk.22">
<exec executable="/usr/bin/env">
<arg value="bash"/>
<arg value="ci/create-abcl-properties.bash"/>
<arg value="openjdk22"/>
</exec>
</target>

<import file="etc/ant/netbeans-build.xml"
optional="true"/>
<import file="etc/ant/build-snapshot.xml"
Expand Down
10 changes: 10 additions & 0 deletions ci/create-abcl-properties.bash
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ case $jdk in
ant_build_javac_target=19
ant_build_javac_source=1.8
;;
21:openjdk21)
options="-XX:CompileThreshold=10 ${opens}"
ant_build_javac_target=21
ant_build_javac_source=1.8
;;
22:openjdk19)
options="-XX:CompileThreshold=10 ${opens}"
ant_build_javac_target=22
ant_build_javac_source=1.8
;;
*)
options="-XX:CompileThreshold=10 ${opens}"
ant_build_javac_target=19
Expand Down
36 changes: 21 additions & 15 deletions ci/set-jdk.bash
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

function set_jdk() {
abcl_jdk=$1
if [[ -z ${abcl_jdk} ]]; then
Expand All @@ -21,23 +23,27 @@ function set_jdk() {

case ${abcl_jdk} in
openjdk8)
version=$(jenv versions | grep ^\ *1\.8\.[0-9] | tail -1 | sed s/*//)
version=$(jenv versions | grep ^..1\.8\.[0-9] | tail -1 | sed s/*// | awk '{print $1}')
;;
openjdk11)
version=$(jenv versions | grep ^\ *11\.[0-9] | tail -1 | sed s/*//)
version=$(jenv versions | grep ^..11\.[0-9] | tail -1 | sed s/*// | awk '{print $1}')
;;
openjdk17)
version=$(jenv versions | grep ^\ *17\.[0-9] | tail -1 | sed s/*//)
version=$(jenv versions | grep ^..17\.[0-9] | tail -1 | sed s/*// | awk '{print $1}')
;;
openjdk17)
version=$(jenv versions | grep ^\ *19\.[0-9] | tail -1 | sed s/*//)
version=$(jenv versions | grep ^..19\.[0-9] | tail -1 | sed s/*// | awk '{print $1}')
;;
openjdk20)
version=$(jenv versions | grep ^\ *20\.[0-9] | tail -1 | sed s/*//)
version=$(jenv versions | grep ^..20\.[0-9] | tail -1 | sed s/*// | awk '{print $1}')
;;
openjdk21)
version=$(jenv versions | grep ^\ *21\.[0-9] | tail -1 | sed s/*//)
version=$(jenv versions | grep ^..21\.[0-9] | tail -1 | sed s/*// | awk '{print $1}')
;;
openjdk22)
version=$(jenv versions | grep ^..22\.[0-9] | tail -1 | sed s/*// | awk '{print $1}')
;;

*)
echo Failed to find an available JDK matching ${abcl_jdk}
echo in $(jenv versions)
Expand All @@ -53,17 +59,17 @@ function set_jdk() {

pushd ${dir}

if [[ 0 -ne $(jenv local ${version}) ]]; then
echo Failed to set local JDK to ${version}
fi
# but practically we guard every invocation of jenv this way
if [[ 0 -ne $(jenv global ${version}) ]]; then
echo Failed to set global JDK to ${version}
fi
jenv local ${version}
if [[ 0 -ne $? ]]; then
echo Failed to set local JDK in ${dir} to ${version}
fi

echo Local version to set $(jenv version)
jenv global ${version}
if [[ 0 -ne $? ]]; then
echo Failed to set global JDK to ${version}
fi

popd
}

set_jdk ${JDK_VERSION} ${ABCL_VERSION}
set_jdk $1 $2