Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fix_2039
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasTu committed Dec 20, 2024
2 parents 8ad5c52 + 9a3ab97 commit cc4160c
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/branches-and-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
fail-fast: false
matrix:
variant: ['2.5', '3.0', '4.0']
java: ['8', '11', '17', '21', '22']
java: ['8', '11', '17', '21', '23']
os: ['ubuntu-latest']
exclude:
- variant: '2.5'
Expand All @@ -30,7 +30,7 @@ jobs:
java: '21'
os: 'ubuntu-latest'
- variant: '2.5'
java: '22'
java: '23'
os: 'ubuntu-latest'
include:
- variant: '2.5'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
variant: ['2.5', '3.0', '4.0']
java: [ '8', '11', '17', '21', '22' ]
java: [ '8', '11', '17', '21', '23' ]
os: [ 'ubuntu-latest' ]
exclude:
- variant: '2.5'
Expand All @@ -25,7 +25,7 @@ jobs:
java: '21'
os: 'ubuntu-latest'
- variant: '2.5'
java: '22'
java: '23'
os: 'ubuntu-latest'
include:
- variant: '2.5'
Expand Down
1 change: 1 addition & 0 deletions docs/release_notes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ include::include.adoc[]
* Add new <<extensions.adoc#default-value-provider,`IDefaultValueProviderExtension`>> extension point to add support for special classes in the Stub's default `EmptyOrDummyResponse` spockPull:1994[]
* Add support for Groovy-4-style range expressions spockIssue:1956[]
* Add `IStatelessAnnotationDrivenExtension` to allow a single extension instance to be reused across all specifications spockPull:2055[]
* Add new well-known versions to `Jvm` helper to support versions up to 29 spockPull:2057[]
** Built-in extensions have been updated to use this new interface where applicable.
* Improve `@Timeout` extension will now use virtual threads if available spockPull:1986[]
* Improve mock argument matching, types constraints or arguments in interactions can now handle primitive types like `_ as int` spockIssue:1974[]
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#

org.gradle.java.installations.auto-download=false
org.gradle.java.installations.fromEnv=JDK8,JDK11,JDK17,JDK21
org.gradle.java.installations.fromEnv=JDK8,JDK11,JDK17,JDK21,JDK23

org.gradle.parallel=true
org.gradle.caching=true
120 changes: 120 additions & 0 deletions spock-core/src/main/java/spock/util/environment/Jvm.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,66 @@ public boolean isJava23() {
return "23".equals(javaSpecVersion);
}

/**
* Tells whether the Java version is 24.
*
* @since 2.4
* @return whether the Java version is 24
*/
public boolean isJava24() {
return "24".equals(javaSpecVersion);
}

/**
* Tells whether the Java version is 25.
*
* @since 2.4
* @return whether the Java version is 25
*/
public boolean isJava25() {
return "25".equals(javaSpecVersion);
}

/**
* Tells whether the Java version is 26.
*
* @since 2.4
* @return whether the Java version is 26
*/
public boolean isJava26() {
return "26".equals(javaSpecVersion);
}

/**
* Tells whether the Java version is 27.
*
* @since 2.4
* @return whether the Java version is 27
*/
public boolean isJava27() {
return "27".equals(javaSpecVersion);
}

/**
* Tells whether the Java version is 28.
*
* @since 2.4
* @return whether the Java version is 28
*/
public boolean isJava28() {
return "28".equals(javaSpecVersion);
}

/**
* Tells whether the Java version is 29.
*
* @since 2.4
* @return whether the Java version is 29
*/
public boolean isJava29() {
return "29".equals(javaSpecVersion);
}

/**
* Tells whether the Java version is equal to the given major Java version.
*
Expand Down Expand Up @@ -383,6 +443,66 @@ public boolean isJava23Compatible() {
return javaSpecVersionNumber.getMajor() >= 23;
}

/**
* Tells whether the Java version is compatible with Java 24.
*
* @since 2.4
* @return whether the Java version is compatible with Java 24
*/
public boolean isJava24Compatible() {
return javaSpecVersionNumber.getMajor() >= 24;
}

/**
* Tells whether the Java version is compatible with Java 25.
*
* @since 2.4
* @return whether the Java version is compatible with Java 25
*/
public boolean isJava25Compatible() {
return javaSpecVersionNumber.getMajor() >= 25;
}

/**
* Tells whether the Java version is compatible with Java 26.
*
* @since 2.4
* @return whether the Java version is compatible with Java 26
*/
public boolean isJava26Compatible() {
return javaSpecVersionNumber.getMajor() >= 26;
}

/**
* Tells whether the Java version is compatible with Java 27.
*
* @since 2.4
* @return whether the Java version is compatible with Java 27
*/
public boolean isJava27Compatible() {
return javaSpecVersionNumber.getMajor() >= 27;
}

/**
* Tells whether the Java version is compatible with Java 28.
*
* @since 2.4
* @return whether the Java version is compatible with Java 28
*/
public boolean isJava28Compatible() {
return javaSpecVersionNumber.getMajor() >= 28;
}

/**
* Tells whether the Java version is compatible with Java 29.
*
* @since 2.4
* @return whether the Java version is compatible with Java 29
*/
public boolean isJava29Compatible() {
return javaSpecVersionNumber.getMajor() >= 29;
}

/**
* Tells whether the Java version is compatible with the given major Java version.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ class Test extends Bar {

@Requires({
jvm.java8 || jvm.java9 || jvm.java10 || jvm.java11 || jvm.java12 || jvm.java13 || jvm.java14 || jvm.java15 || jvm.java16 || jvm.java17 ||
jvm.isJavaVersion(18) || jvm.java21 || jvm.java22
jvm.isJavaVersion(18) ||
jvm.java21 || jvm.java22 || jvm.java23 || jvm.java24 || jvm.java25 || jvm.java26 || jvm.java27 || jvm.java28 || jvm.java29
})
def "provides JVM information"() {
expect: true
Expand Down

0 comments on commit cc4160c

Please sign in to comment.