From 096b6675206e5c677531050e122bd6301cec86cb Mon Sep 17 00:00:00 2001 From: Marco Belladelli Date: Tue, 5 Mar 2024 09:44:12 +0100 Subject: [PATCH] HHH-17805 Fix jpamodelgen quarkus/jd tests with jdk >= 17 --- .../hibernate-jpamodelgen.gradle | 49 +++++++++++++++---- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/tooling/metamodel-generator/hibernate-jpamodelgen.gradle b/tooling/metamodel-generator/hibernate-jpamodelgen.gradle index 0c57c8b97b..33a05e0054 100644 --- a/tooling/metamodel-generator/hibernate-jpamodelgen.gradle +++ b/tooling/metamodel-generator/hibernate-jpamodelgen.gradle @@ -130,20 +130,51 @@ compileTestJava { // Tests with records if ( jdkVersions.test.release.asInt() >= 17 && jdkVersions.explicit ) { // We need to configure the source and target version to 17 - //compileTestJava17Java { + def testCompilerConfig = { + javaCompiler = javaToolchains.compilerFor { + languageVersion = jdkVersions.test.compile + } + sourceCompatibility = 17 + targetCompatibility = 17 + } + compileTestJava { - javaCompiler = javaToolchains.compilerFor { - languageVersion = jdkVersions.test.compile - } - sourceCompatibility = 17 - targetCompatibility = 17 + configure testCompilerConfig } + compileQuarkusOrmPanacheJava { + configure testCompilerConfig + } + + compileQuarkusHrPanacheJava { + configure testCompilerConfig + } + + compileJakartaDataJava { + configure testCompilerConfig + } + + def testLauncherConfig = { + javaLauncher = javaToolchains.launcherFor { + languageVersion = jdkVersions.test.launcher + } + } + test { - javaLauncher = javaToolchains.launcherFor { - languageVersion = jdkVersions.test.launcher - } + configure testLauncherConfig } + + quarkusOrmPanacheTest { + configure testLauncherConfig + } + + quarkusHrPanacheTest { + configure testLauncherConfig + } + + jakartaDataTest { + configure testLauncherConfig + } } else { sourceSets {