Merge pull request #21713 from dreis2211
* pr/21713: Polish "Add Java 15 CI" Add Java 15 CI Allow StringSequence.isEmpty() to be compatible with JDK 15 Use Class.getName() as fallback in HandlerFunctionDescription Closes gh-21713
This commit is contained in:
@@ -11,6 +11,9 @@ case "$1" in
|
||||
java14)
|
||||
echo "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14.0.1%2B7/OpenJDK14U-jdk_x64_linux_hotspot_14.0.1_7.tar.gz"
|
||||
;;
|
||||
java15)
|
||||
echo "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15-2020-06-15-05-34/OpenJDK15-jdk_x64_linux_hotspot_2020-06-15-05-34.tar.gz"
|
||||
;;
|
||||
*)
|
||||
echo $"Unknown java version"
|
||||
exit 1
|
||||
|
||||
12
ci/images/spring-boot-jdk15-ci-image/Dockerfile
Normal file
12
ci/images/spring-boot-jdk15-ci-image/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM ubuntu:bionic-20200403
|
||||
|
||||
ADD setup.sh /setup.sh
|
||||
ADD get-jdk-url.sh /get-jdk-url.sh
|
||||
ADD get-docker-url.sh /get-docker-url.sh
|
||||
RUN ./setup.sh java15
|
||||
|
||||
ENV JAVA_HOME /opt/openjdk
|
||||
ENV PATH $JAVA_HOME/bin:$PATH
|
||||
ADD docker-lib.sh /docker-lib.sh
|
||||
|
||||
ENTRYPOINT [ "switch", "shell=/bin/bash", "--", "codep", "/bin/docker daemon" ]
|
||||
@@ -151,6 +151,12 @@ resources:
|
||||
source:
|
||||
<<: *docker-resource-source
|
||||
repository: ((docker-hub-organization))/spring-boot-jdk14-ci-image
|
||||
- name: spring-boot-jdk15-ci-image
|
||||
type: docker-image
|
||||
icon: docker
|
||||
source:
|
||||
<<: *docker-resource-source
|
||||
repository: ((docker-hub-organization))/spring-boot-jdk15-ci-image
|
||||
- name: artifactory-repo
|
||||
type: artifactory-resource
|
||||
icon: package-variant
|
||||
@@ -183,6 +189,14 @@ resources:
|
||||
access_token: ((github-ci-status-token))
|
||||
branch: ((branch))
|
||||
context: jdk14-build
|
||||
- name: repo-status-jdk15-build
|
||||
type: github-status-resource
|
||||
icon: eye-check-outline
|
||||
source:
|
||||
repository: ((github-repo-name))
|
||||
access_token: ((github-ci-status-token))
|
||||
branch: ((branch))
|
||||
context: jdk15-build
|
||||
- name: slack-alert
|
||||
type: slack-notification
|
||||
icon: slack
|
||||
@@ -217,6 +231,10 @@ jobs:
|
||||
params:
|
||||
build: ci-images-git-repo/ci/images
|
||||
dockerfile: ci-images-git-repo/ci/images/spring-boot-jdk14-ci-image/Dockerfile
|
||||
- put: spring-boot-jdk15-ci-image
|
||||
params:
|
||||
build: ci-images-git-repo/ci/images
|
||||
dockerfile: ci-images-git-repo/ci/images/spring-boot-jdk15-ci-image/Dockerfile
|
||||
- name: detect-jdk-updates
|
||||
plan:
|
||||
- get: git-repo
|
||||
@@ -242,6 +260,12 @@ jobs:
|
||||
params:
|
||||
<<: *github-task-params
|
||||
JDK_VERSION: java14
|
||||
- task: detect-jdk15-update
|
||||
image: spring-boot-ci-image
|
||||
file: git-repo/ci/tasks/detect-jdk-updates.yml
|
||||
params:
|
||||
<<: *github-task-params
|
||||
JDK_VERSION: java15
|
||||
- name: detect-ubuntu-image-updates
|
||||
plan:
|
||||
- get: git-repo
|
||||
@@ -378,7 +402,32 @@ jobs:
|
||||
params: { state: "success", commit: "git-repo" }
|
||||
- put: slack-alert
|
||||
params:
|
||||
<<: *slack-success-params
|
||||
<<: *slack-success-params
|
||||
- name: jdk15-build
|
||||
serial: true
|
||||
public: true
|
||||
plan:
|
||||
- get: spring-boot-jdk15-ci-image
|
||||
- get: git-repo
|
||||
trigger: true
|
||||
- put: repo-status-jdk15-build
|
||||
params: { state: "pending", commit: "git-repo" }
|
||||
- do:
|
||||
- task: build-project
|
||||
image: spring-boot-jdk15-ci-image
|
||||
<<: *build-project-task-params
|
||||
on_failure:
|
||||
do:
|
||||
- put: repo-status-jdk15-build
|
||||
params: { state: "failure", commit: "git-repo" }
|
||||
- put: slack-alert
|
||||
params:
|
||||
<<: *slack-fail-params
|
||||
- put: repo-status-jdk15-build
|
||||
params: { state: "success", commit: "git-repo" }
|
||||
- put: slack-alert
|
||||
params:
|
||||
<<: *slack-success-params
|
||||
- name: windows-build
|
||||
serial: true
|
||||
plan:
|
||||
@@ -568,7 +617,7 @@ jobs:
|
||||
body: generated-release-notes/release-notes.md
|
||||
groups:
|
||||
- name: "Build"
|
||||
jobs: ["build", "jdk11-build", "jdk14-build", "windows-build"]
|
||||
jobs: ["build", "jdk11-build", "jdk14-build", "jdk15-build", "windows-build"]
|
||||
- name: "Release"
|
||||
jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "sync-to-maven-central"]
|
||||
- name: "CI Images"
|
||||
|
||||
@@ -2,23 +2,27 @@
|
||||
|
||||
case "$JDK_VERSION" in
|
||||
java8)
|
||||
BASE_URL="https://api.adoptopenjdk.net/v3/assets/feature_releases/8"
|
||||
BASE_URL="https://api.adoptopenjdk.net/v3/assets/feature_releases/8/ga"
|
||||
ISSUE_TITLE="Upgrade Java 8 version in CI image"
|
||||
;;
|
||||
java11)
|
||||
BASE_URL="https://api.adoptopenjdk.net/v3/assets/feature_releases/11"
|
||||
BASE_URL="https://api.adoptopenjdk.net/v3/assets/feature_releases/11/ga"
|
||||
ISSUE_TITLE="Upgrade Java 11 version in CI image"
|
||||
;;
|
||||
java14)
|
||||
BASE_URL="https://api.adoptopenjdk.net/v3/assets/feature_releases/14"
|
||||
BASE_URL="https://api.adoptopenjdk.net/v3/assets/feature_releases/14/ga"
|
||||
ISSUE_TITLE="Upgrade Java 14 version in CI image"
|
||||
;;
|
||||
java15)
|
||||
BASE_URL="https://api.adoptopenjdk.net/v3/assets/feature_releases/15/ea"
|
||||
ISSUE_TITLE="Upgrade Java 15 version in CI image"
|
||||
;;
|
||||
*)
|
||||
echo $"Unknown java version"
|
||||
exit 1;
|
||||
esac
|
||||
|
||||
response=$( curl -s ${BASE_URL}\/ga\?architecture\=x64\&heap_size\=normal\&image_type\=jdk\&jvm_impl\=hotspot\&os\=linux\&sort_order\=DESC\&vendor\=adoptopenjdk )
|
||||
response=$( curl -s ${BASE_URL}\?architecture\=x64\&heap_size\=normal\&image_type\=jdk\&jvm_impl\=hotspot\&os\=linux\&sort_order\=DESC\&vendor\=adoptopenjdk )
|
||||
latest=$( jq -r '.[0].binaries[0].package.link' <<< "$response" )
|
||||
|
||||
current=$( git-repo/ci/images/get-jdk-url.sh ${JDK_VERSION} )
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,7 +29,13 @@ public class HandlerFunctionDescription {
|
||||
private final String className;
|
||||
|
||||
HandlerFunctionDescription(HandlerFunction<?> handlerFunction) {
|
||||
this.className = handlerFunction.getClass().getCanonicalName();
|
||||
this.className = getHandlerFunctionClassName(handlerFunction);
|
||||
}
|
||||
|
||||
private static String getHandlerFunctionClassName(HandlerFunction<?> handlerFunction) {
|
||||
Class<?> functionClass = handlerFunction.getClass();
|
||||
String canonicalName = functionClass.getCanonicalName();
|
||||
return (canonicalName != null) ? canonicalName : functionClass.getName();
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
|
||||
@@ -72,7 +72,11 @@ final class StringSequence implements CharSequence {
|
||||
return new StringSequence(this.source, subSequenceStart, subSequenceEnd);
|
||||
}
|
||||
|
||||
boolean isEmpty() {
|
||||
/**
|
||||
* Returns {@code true} if the sequence is empty. Public to be compatible with JDK 15.
|
||||
* @return {@code true} if {@link #length()} is {@code 0}, otherwise {@code false}
|
||||
*/
|
||||
public boolean isEmpty() {
|
||||
return length() == 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,4 +46,5 @@
|
||||
<suppress files="[\\/]src[\\/]intTest[\\/]java[\\/]" checks="SpringJavadoc" message="\@since" />
|
||||
<suppress files="LinuxDomainSocket" checks="FinalClass" message="SockaddrUn" />
|
||||
<suppress files="BsdDomainSocket" checks="FinalClass" message="SockaddrUn" />
|
||||
<suppress files="StringSequence" checks="SpringMethodVisibility" />
|
||||
</suppressions>
|
||||
|
||||
Reference in New Issue
Block a user