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

Prepare compiling and testing for Java 23 #29016

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,9 @@ public enum JavaVersion {

/**
* Java 23 major version.
* Not officially supported by Gradle. Use at your own risk.
*
* @since 7.6
*/
@Incubating
VERSION_23,

/**
Expand Down Expand Up @@ -147,6 +145,15 @@ public enum JavaVersion {
@Incubating
VERSION_26,

/**
* Java 27 major version.
* Not officially supported by Gradle. Use at your own risk.
*
* @since 8.9
*/
@Incubating
VERSION_27,

/**
* Higher version of Java.
* @since 4.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class JavaVersionSpec extends Specification {
JavaVersion.VERSION_24.toString() == "24"
JavaVersion.VERSION_25.toString() == "25"
JavaVersion.VERSION_26.toString() == "26"
JavaVersion.VERSION_HIGHER.toString() == "27"
JavaVersion.VERSION_27.toString() == "27"
JavaVersion.VERSION_HIGHER.toString() == "28"
}

def convertsStringToVersion() {
Expand Down Expand Up @@ -130,6 +131,7 @@ class JavaVersionSpec extends Specification {
JavaVersion.forClassVersion(68) == JavaVersion.VERSION_24
JavaVersion.forClassVersion(69) == JavaVersion.VERSION_25
JavaVersion.forClassVersion(70) == JavaVersion.VERSION_26
JavaVersion.forClassVersion(71) == JavaVersion.VERSION_27
JavaVersion.forClassVersion(999) == JavaVersion.VERSION_HIGHER
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ The previous step will help you identify potential problems by issuing deprecati

The embedded Kotlin has been updated from 1.9.22 to link:https://github.com/JetBrains/kotlin/releases/tag/v1.9.23[Kotlin 1.9.23].

==== Upgrade to JaCoCo 0.8.12

JaCoCo has been updated to https://www.jacoco.org/jacoco/trunk/doc/changes.html[0.8.12].

[[changes_8.8]]
== Upgrading from 8.7 and earlier

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public abstract class JacocoPlugin implements Plugin<Project> {
*
* @since 3.4
*/
public static final String DEFAULT_JACOCO_VERSION = "0.8.11";
public static final String DEFAULT_JACOCO_VERSION = "0.8.12";
public static final String AGENT_CONFIGURATION_NAME = "jacocoAgent";
public static final String ANT_CONFIGURATION_NAME = "jacocoAnt";
public static final String PLUGIN_EXTENSION_NAME = "jacoco";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ final class JacocoCoverage {
// Order matters here, as we want to test the latest version first
// Relies on Groovy keeping the order of the keys in a map literal
private static final Map<JavaVersion, JacocoVersion> JDK_CUTOFFS = [
(JavaVersion.VERSION_23): JacocoVersion.SUPPORTS_JDK_23,
(JavaVersion.VERSION_21): JacocoVersion.SUPPORTS_JDK_21,
(JavaVersion.VERSION_20): JacocoVersion.SUPPORTS_JDK_20,
(JavaVersion.VERSION_18): JacocoVersion.SUPPORTS_JDK_18,
Expand Down Expand Up @@ -61,6 +62,7 @@ final class JacocoCoverage {
static final SUPPORTS_JDK_18 = new JacocoVersion(0, 8, 8)
static final SUPPORTS_JDK_20 = new JacocoVersion(0, 8, 9)
static final SUPPORTS_JDK_21 = new JacocoVersion(0, 8, 11)
static final SUPPORTS_JDK_23 = new JacocoVersion(0, 8, 12)

private final int major
private final int minor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import static org.gradle.internal.serialize.JavaClassUtil.getClassMajorVersion
class JavaCrossCompilationIntegrationTest extends AbstractIntegrationSpec {

static List<String> javaVersionsToCrossCompileAgainst() {
return ["1.6", "1.7", "1.8", "11", "15", "16", "17", "18", "19", "20", "21", "22"]
return ["1.6", "1.7", "1.8", "11", "15", "16", "17", "18", "19", "20", "21", "22", "23"]
}

static JavaVersion toJavaVersion(String version) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class ScalaCompileJavaToolchainIntegrationTest1 extends AbstractScalaCompileJava
JavaVersion.forClass(classFile("scala", "test", "ScalaTest.class").bytes) == JavaVersion.VERSION_1_8

where:
javaVersion << JavaVersion.values().findAll { JavaVersion.VERSION_1_8 <= it && it <= JavaVersion.VERSION_22 }
javaVersion << JavaVersion.values().findAll { JavaVersion.VERSION_1_8 <= it && it <= JavaVersion.VERSION_23 }
}
}

Expand Down