From 4f884f0bc5e3d8e8f421ff831c702879f85e3ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Tue, 20 Feb 2024 15:45:25 +0100 Subject: [PATCH] Revert "Make sure test.jdk.launcher.args is passed as jvm args to test launcher" This reverts commit d7a46451ce7bc3ba3ce3cb0a7eada5ab824e4e1a. --- .../orm/toolchains/JavaModulePlugin.java | 5 ---- .../orm/toolchains/JdkVersionConfig.java | 24 +++++-------------- .../orm/toolchains/JdkVersionPlugin.java | 6 +---- .../toolchains/JdkVersionSettingsPlugin.java | 8 +------ 4 files changed, 8 insertions(+), 35 deletions(-) diff --git a/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JavaModulePlugin.java b/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JavaModulePlugin.java index 6be372d5b7..e197951b8d 100644 --- a/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JavaModulePlugin.java +++ b/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JavaModulePlugin.java @@ -81,11 +81,6 @@ public class JavaModulePlugin implements Plugin { javaToolchainSpec.getLanguageVersion().set( jdkVersionsConfig.getTestLauncherVersion() ); } ) ); - - final String launcherArgs = jdkVersionsConfig.getTest().getLauncherArgs(); - if ( launcherArgs != null ) { - testTask.jvmArgs( (Object[]) launcherArgs.split( " " ) ); - } } } } diff --git a/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JdkVersionConfig.java b/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JdkVersionConfig.java index eb7a9582ce..18020922f8 100644 --- a/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JdkVersionConfig.java +++ b/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JdkVersionConfig.java @@ -30,7 +30,6 @@ public class JdkVersionConfig { public static final String DSL_NAME = "jdkVersions"; public static final String MAIN_JDK_VERSION = "main.jdk.version"; public static final String TEST_JDK_VERSION = "test.jdk.version"; - public static final String TEST_JDK_LAUNCHER_ARGS = "test.jdk.launcher.args"; private final boolean explicit; private final JavaLanguageVersion baseline; @@ -44,12 +43,11 @@ public class JdkVersionConfig { JavaLanguageVersion mainReleaseVersion, JavaLanguageVersion testCompileVersion, JavaLanguageVersion testReleaseVersion, - JavaLanguageVersion testLauncherVersion, - String testLauncherArgs) { + JavaLanguageVersion testLauncherVersion) { this.explicit = explicit; this.baseline = baseline; this.main = new MainJdks( mainCompileVersion, mainReleaseVersion ); - this.test = new TestJdks( testCompileVersion, testReleaseVersion, testLauncherVersion, testLauncherArgs ); + this.test = new TestJdks( testCompileVersion, testReleaseVersion, testLauncherVersion ); } public boolean isExplicitlyConfigured() { @@ -112,8 +110,7 @@ public class JdkVersionConfig { JavaLanguageVersion explicitTestVersion, JavaLanguageVersion gradleJdkVersion, JavaLanguageVersion baselineJdkVersion, - JavaLanguageVersion maxSupportedJdkVersion, - String testLauncherArgs) { + JavaLanguageVersion maxSupportedJdkVersion) { final boolean explicitlyConfigured = explicitMainVersion != null || explicitTestVersion != null; final JavaLanguageVersion mainCompileVersion; @@ -147,8 +144,7 @@ public class JdkVersionConfig { mainReleaseVersion, testCompileVersion, testReleaseVersion, - testLauncherVersion, - testLauncherArgs + testLauncherVersion ); } else { @@ -173,8 +169,7 @@ public class JdkVersionConfig { baselineJdkVersion, gradleJdkVersion, baselineJdkVersion, - gradleJdkVersion, - testLauncherArgs + gradleJdkVersion ); } } @@ -250,17 +245,14 @@ public class JdkVersionConfig { private final JavaLanguageVersion compileVersion; private final JavaLanguageVersion releaseVersion; private final JavaLanguageVersion launcherVersion; - private final String launcherArgs; public TestJdks( JavaLanguageVersion compileVersion, JavaLanguageVersion releaseVersion, - JavaLanguageVersion launcherVersion, - String launcherArgs) { + JavaLanguageVersion launcherVersion) { this.compileVersion = compileVersion; this.releaseVersion = releaseVersion; this.launcherVersion = launcherVersion; - this.launcherArgs = launcherArgs; } public JavaLanguageVersion getCompiler() { @@ -281,10 +273,6 @@ public class JdkVersionConfig { return launcherVersion; } - public String getLauncherArgs() { - return launcherArgs; - } - @Override public String toString() { return "[compile: " + compileVersion + ", release:" + releaseVersion + ", launcher: " + launcherVersion + "]"; diff --git a/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JdkVersionPlugin.java b/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JdkVersionPlugin.java index ee79cfe6eb..e9ad316048 100644 --- a/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JdkVersionPlugin.java +++ b/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JdkVersionPlugin.java @@ -26,7 +26,6 @@ import org.gradle.jvm.toolchain.JavaToolchainSpec; import org.jetbrains.annotations.NotNull; import static org.hibernate.orm.toolchains.JdkVersionConfig.MAIN_JDK_VERSION; -import static org.hibernate.orm.toolchains.JdkVersionConfig.TEST_JDK_LAUNCHER_ARGS; import static org.hibernate.orm.toolchains.JdkVersionConfig.TEST_JDK_VERSION; import static org.hibernate.orm.toolchains.JdkVersionConfig.createVersionConfig; import static org.hibernate.orm.toolchains.JdkVersionConfig.extractVersion; @@ -52,16 +51,13 @@ public class JdkVersionPlugin implements Plugin { final VersionCatalog jdkVersions = versionCatalogs.named( "jdks" ); final JavaLanguageVersion baselineJdkVersion = getJavaLanguageVersion( jdkVersions, "baseline" ); final JavaLanguageVersion maxSupportedJdkVersion = getJavaLanguageVersion( jdkVersions, "maxSupportedBytecode" ); - final Object testLauncherArgsObject = project.getProperties().get( TEST_JDK_LAUNCHER_ARGS ); - final String testLauncherArgs = testLauncherArgsObject == null ? null : testLauncherArgsObject.toString(); final JdkVersionConfig jdkVersionConfig = createVersionConfig( explicitMainVersion, explicitTestVersion, gradleJdkVersion, baselineJdkVersion, - maxSupportedJdkVersion, - testLauncherArgs + maxSupportedJdkVersion ); project.getExtensions().add( JdkVersionConfig.DSL_NAME, jdkVersionConfig ); diff --git a/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JdkVersionSettingsPlugin.java b/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JdkVersionSettingsPlugin.java index 245f19ead5..66b3f19dbd 100644 --- a/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JdkVersionSettingsPlugin.java +++ b/local-build-plugins/src/main/java/org/hibernate/orm/toolchains/JdkVersionSettingsPlugin.java @@ -6,7 +6,6 @@ */ package org.hibernate.orm.toolchains; -import org.gradle.StartParameter; import org.gradle.api.JavaVersion; import org.gradle.api.Plugin; import org.gradle.api.artifacts.VersionCatalog; @@ -18,7 +17,6 @@ import org.gradle.jvm.toolchain.JavaLanguageVersion; import org.jetbrains.annotations.NotNull; import static org.hibernate.orm.toolchains.JdkVersionConfig.MAIN_JDK_VERSION; -import static org.hibernate.orm.toolchains.JdkVersionConfig.TEST_JDK_LAUNCHER_ARGS; import static org.hibernate.orm.toolchains.JdkVersionConfig.TEST_JDK_VERSION; import static org.hibernate.orm.toolchains.JdkVersionConfig.createVersionConfig; import static org.hibernate.orm.toolchains.JdkVersionConfig.extractVersion; @@ -41,17 +39,13 @@ public class JdkVersionSettingsPlugin implements Plugin { // maxSupportedJdkVersion = getJavaLanguageVersion( jdkVersions, "maxSupportedBytecode" ); baselineJdkVersion = JavaLanguageVersion.of( "11" ); maxSupportedJdkVersion = JavaLanguageVersion.of( "17" ); - final StartParameter startParameters = settings.getGradle().getStartParameter(); - final Object testLauncherArgsObject = startParameters.getProjectProperties().get( TEST_JDK_LAUNCHER_ARGS ); - final String testLauncherArgs = testLauncherArgsObject == null ? null : testLauncherArgsObject.toString(); final JdkVersionConfig jdkVersionConfig = createVersionConfig( explicitMainVersion, explicitTestVersion, gradleJdkVersion, baselineJdkVersion, - maxSupportedJdkVersion, - testLauncherArgs + maxSupportedJdkVersion ); settings.getGradle().getExtensions().add( JdkVersionConfig.DSL_NAME, jdkVersionConfig );