Browse Source

Configure JDK 22 compatibility build on CI

This commit does not enable this build right now as testing libraries
are not ready yet for JDK 22.

See gh-31459
pull/31466/head
Brian Clozel 1 year ago
parent
commit
c73c16f07f
  1. 1
      ci/images/ci-image/Dockerfile
  2. 3
      ci/images/get-jdk-url.sh
  3. 2
      ci/images/setup.sh
  4. 36
      ci/pipeline.yml
  5. 2
      ci/scripts/build-project.sh
  6. 5
      gradle/toolchains.gradle

1
ci/images/ci-image/Dockerfile

@ -7,5 +7,6 @@ RUN ./setup.sh
ENV JAVA_HOME /opt/openjdk/java17 ENV JAVA_HOME /opt/openjdk/java17
ENV JDK17 /opt/openjdk/java17 ENV JDK17 /opt/openjdk/java17
ENV JDK21 /opt/openjdk/java21 ENV JDK21 /opt/openjdk/java21
ENV JDK22 /opt/openjdk/java22
ENV PATH $JAVA_HOME/bin:$PATH ENV PATH $JAVA_HOME/bin:$PATH

3
ci/images/get-jdk-url.sh

@ -8,6 +8,9 @@ case "$1" in
java21) java21)
echo "https://download.bell-sw.com/java/21.0.1+12/bellsoft-jdk21.0.1+12-linux-amd64.tar.gz" echo "https://download.bell-sw.com/java/21.0.1+12/bellsoft-jdk21.0.1+12-linux-amd64.tar.gz"
;; ;;
java22)
echo "https://download.java.net/java/early_access/jdk22/19/GPL/openjdk-22-ea+19_linux-x64_bin.tar.gz"
;;
*) *)
echo $"Unknown java version" echo $"Unknown java version"
exit 1 exit 1

2
ci/images/setup.sh

@ -20,7 +20,7 @@ curl https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.4/c
mkdir -p /opt/openjdk mkdir -p /opt/openjdk
pushd /opt/openjdk > /dev/null pushd /opt/openjdk > /dev/null
for jdk in java17 java21 for jdk in java17 java21 java22
do do
JDK_URL=$( /get-jdk-url.sh $jdk ) JDK_URL=$( /get-jdk-url.sh $jdk )
mkdir $jdk mkdir $jdk

36
ci/pipeline.yml

@ -121,6 +121,14 @@ resources:
access_token: ((github-ci-status-token)) access_token: ((github-ci-status-token))
branch: ((branch)) branch: ((branch))
context: jdk21-build context: jdk21-build
- name: repo-status-jdk22-build
type: github-status-resource
icon: eye-check-outline
source:
repository: ((github-repo-name))
access_token: ((github-ci-status-token))
branch: ((branch))
context: jdk22-build
- name: slack-alert - name: slack-alert
type: slack-notification type: slack-notification
icon: slack icon: slack
@ -241,6 +249,32 @@ jobs:
<<: *slack-fail-params <<: *slack-fail-params
- put: repo-status-jdk21-build - put: repo-status-jdk21-build
params: { state: "success", commit: "git-repo" } params: { state: "success", commit: "git-repo" }
- name: jdk22-build
serial: true
public: true
plan:
- get: ci-image
- get: git-repo
- put: repo-status-jdk22-build
params: { state: "pending", commit: "git-repo" }
- do:
- task: check-project
image: ci-image
file: git-repo/ci/tasks/check-project.yml
privileged: true
timeout: ((task-timeout))
params:
TEST_TOOLCHAIN: 22
<<: *build-project-task-params
on_failure:
do:
- put: repo-status-jdk22-build
params: { state: "failure", commit: "git-repo" }
- put: slack-alert
params:
<<: *slack-fail-params
- put: repo-status-jdk22-build
params: { state: "success", commit: "git-repo" }
- name: stage-milestone - name: stage-milestone
serial: true serial: true
plan: plan:
@ -392,7 +426,7 @@ jobs:
groups: groups:
- name: "builds" - name: "builds"
jobs: ["build", "jdk21-build"] jobs: ["build", "jdk21-build", "jdk22-build"]
- name: "releases" - name: "releases"
jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "create-github-release"] jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "create-github-release"]
- name: "ci-images" - name: "ci-images"

2
ci/scripts/build-project.sh

@ -5,6 +5,6 @@ source $(dirname $0)/common.sh
repository=$(pwd)/distribution-repository repository=$(pwd)/distribution-repository
pushd git-repo > /dev/null pushd git-repo > /dev/null
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false -Porg.gradle.java.installations.fromEnv=JDK17,JDK21 \ ./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false -Porg.gradle.java.installations.fromEnv=JDK17,JDK21,JDK22 \
--no-daemon --max-workers=4 -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository --no-daemon --max-workers=4 -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository
popd > /dev/null popd > /dev/null

5
gradle/toolchains.gradle

@ -54,6 +54,11 @@ plugins.withType(JavaPlugin).configureEach {
javaLauncher = javaToolchains.launcherFor { javaLauncher = javaToolchains.launcherFor {
languageVersion = testLanguageVersion languageVersion = testLanguageVersion
} }
// Enable Java experimental support in Bytebuddy
// Remove when JDK 22 is supported by Mockito
if (testLanguageVersion == JavaLanguageVersion.of(22)) {
jvmArgs("-Dnet.bytebuddy.experimental=true")
}
} }
} }
} }

Loading…
Cancel
Save