Added Adoptium JDK8 support and updated DistroTestPlugin JDK version used by Gradle (#3324)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
This commit is contained in:
Andriy Redko 2022-05-13 17:39:14 -04:00 committed by GitHub
parent 065e3cb80b
commit e074395452
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 19 deletions

View File

@ -54,7 +54,7 @@ public class Jdk implements Buildable, Iterable<File> {
Arrays.asList("darwin", "freebsd", "linux", "mac", "windows")
);
private static final Pattern VERSION_PATTERN = Pattern.compile("(\\d+)(\\.\\d+\\.\\d+)?\\+(\\d+(?:\\.\\d+)?)(@([a-f0-9]{32}))?");
private static final Pattern LEGACY_VERSION_PATTERN = Pattern.compile("(\\d)(u\\d+)\\+(b\\d+?)(@([a-f0-9]{32}))?");
private static final Pattern LEGACY_VERSION_PATTERN = Pattern.compile("(\\d)(u\\d+)(?:\\+|\\-)(b\\d+?)(@([a-f0-9]{32}))?");
private final String name;
private final Configuration configuration;

View File

@ -110,22 +110,38 @@ public class JdkDownloadPlugin implements Plugin<Project> {
if (jdk.getVendor().equals(VENDOR_ADOPTIUM)) {
repoUrl = "https://github.com/adoptium/temurin" + jdk.getMajor() + "-binaries/releases/download/";
// JDK updates are suffixed with 'U' (fe OpenJDK17U), whereas GA releases are not (fe OpenJDK17).
// To distinguish between those, the GA releases have only major version component (fe 17+32),
// the updates always have minor/patch components (fe 17.0.1+12), checking for the presence of
// version separator '.' should be enough.
artifactPattern = "jdk-"
+ jdk.getBaseVersion()
+ "+"
+ jdk.getBuild()
+ "/OpenJDK"
+ jdk.getMajor()
+ (jdk.getBaseVersion().contains(".") ? "U" : "")
+ "-jdk_[classifier]_[module]_hotspot_"
+ jdk.getBaseVersion()
+ "_"
+ jdk.getBuild()
+ ".[ext]";
if (jdk.getMajor().equals("8")) {
// JDK-8 updates are always suffixed with 'U' (fe OpenJDK8U).
artifactPattern = "jdk"
+ jdk.getBaseVersion()
+ "-"
+ jdk.getBuild()
+ "/OpenJDK"
+ jdk.getMajor()
+ "U"
+ "-jdk_[classifier]_[module]_hotspot_"
+ jdk.getBaseVersion()
+ jdk.getBuild()
+ ".[ext]";
} else {
// JDK updates are suffixed with 'U' (fe OpenJDK17U), whereas GA releases are not (fe OpenJDK17).
// To distinguish between those, the GA releases have only major version component (fe 17+32),
// the updates always have minor/patch components (fe 17.0.1+12), checking for the presence of
// version separator '.' should be enough.
artifactPattern = "jdk-"
+ jdk.getBaseVersion()
+ "+"
+ jdk.getBuild()
+ "/OpenJDK"
+ jdk.getMajor()
+ (jdk.getBaseVersion().contains(".") ? "U" : "")
+ "-jdk_[classifier]_[module]_hotspot_"
+ jdk.getBaseVersion()
+ "_"
+ jdk.getBuild()
+ ".[ext]";
}
} else if (jdk.getVendor().equals(VENDOR_ADOPTOPENJDK)) {
repoUrl = "https://api.adoptopenjdk.net/v3/binary/version/";
if (jdk.getMajor().equals("8")) {

View File

@ -75,8 +75,8 @@ import java.util.function.Supplier;
import java.util.stream.Stream;
public class DistroTestPlugin implements Plugin<Project> {
private static final String SYSTEM_JDK_VERSION = "8u242+b08";
private static final String SYSTEM_JDK_VENDOR = "adoptopenjdk";
private static final String SYSTEM_JDK_VERSION = "11.0.15+10";
private static final String SYSTEM_JDK_VENDOR = "adoptium";
private static final String GRADLE_JDK_VERSION = "17.0.3+7";
private static final String GRADLE_JDK_VENDOR = "adoptium";