Skip to content

Commit bd3020b

Browse files
committed
fix build for JDK24+ (take 2, test our explicit target version)
1 parent 1cb9497 commit bd3020b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

subprojects/groovy-ant/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
import org.apache.groovy.gradle.TargetJavaHomeSupport
20+
1921
plugins {
2022
id 'org.apache.groovy-library'
2123
}
@@ -41,7 +43,9 @@ dependencies {
4143
}
4244

4345
tasks.withType(Test).configureEach {
44-
if (JavaVersion.current() < JavaVersion.VERSION_24) {
46+
Integer feature = TargetJavaHomeSupport.featureVersionFromReleaseFile(TargetJavaHomeSupport.targetJavaHome(project))
47+
boolean testJdkPre24 = feature != null ? feature < 24 : JavaVersion.current() < JavaVersion.VERSION_24
48+
if (testJdkPre24) {
4549
// Setting isn't allowed for Java 24+ but hushes security manager warnings from Ant for JDK17-23
4650
jvmArgs '-Djava.security.manager=allow'
4751
}

0 commit comments

Comments
 (0)