From 82651778e644dc7c25d6e790b2b4b4c2df9e2b3d Mon Sep 17 00:00:00 2001 From: Thorsten Date: Thu, 11 Jul 2024 14:35:26 +0200 Subject: [PATCH 01/13] Fix ConfigurationCache Signed-off-by: Thorsten --- .../java/org/openjfx/gradle/JavaFXModule.java | 10 ++---- .../org/openjfx/gradle/JavaFXOptions.java | 33 +++++++++++++------ .../java/org/openjfx/gradle/JavaFXPlugin.java | 24 ++++++++------ 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/src/main/java/org/openjfx/gradle/JavaFXModule.java b/src/main/java/org/openjfx/gradle/JavaFXModule.java index 00079ce..a412329 100644 --- a/src/main/java/org/openjfx/gradle/JavaFXModule.java +++ b/src/main/java/org/openjfx/gradle/JavaFXModule.java @@ -31,10 +31,7 @@ import org.gradle.api.GradleException; -import java.util.List; -import java.util.Locale; -import java.util.Optional; -import java.util.Set; +import java.util.*; import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -81,16 +78,15 @@ public boolean compareJarFileName(JavaFXPlatform platform, String jarFileName) { return p.matcher(jarFileName).matches(); } - public static Set getJavaFXModules(List moduleNames) { + public static Set getJavaFXModules(Collection moduleNames) { validateModules(moduleNames); - return moduleNames.stream() .map(JavaFXModule::fromModuleName) .flatMap(Optional::stream) .collect(Collectors.toSet()); } - public static void validateModules(List moduleNames) { + public static void validateModules(Collection moduleNames) { var invalidModules = moduleNames.stream() .filter(module -> JavaFXModule.fromModuleName(module).isEmpty()) .collect(Collectors.toList()); diff --git a/src/main/java/org/openjfx/gradle/JavaFXOptions.java b/src/main/java/org/openjfx/gradle/JavaFXOptions.java index ed21a13..c48a296 100644 --- a/src/main/java/org/openjfx/gradle/JavaFXOptions.java +++ b/src/main/java/org/openjfx/gradle/JavaFXOptions.java @@ -36,13 +36,14 @@ import org.gradle.api.artifacts.dsl.RepositoryHandler; import org.gradle.api.artifacts.repositories.FlatDirectoryArtifactRepository; import org.gradle.api.model.ObjectFactory; +import org.gradle.api.provider.Property; +import org.gradle.api.provider.SetProperty; import org.gradle.api.tasks.SourceSetContainer; import org.gradle.nativeplatform.MachineArchitecture; import org.gradle.nativeplatform.OperatingSystemFamily; import javax.inject.Inject; import java.io.File; -import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -54,13 +55,13 @@ abstract public class JavaFXOptions { static final String MAVEN_JAVAFX_ARTIFACT_GROUP_ID = "org.openjfx"; private static final String JAVAFX_SDK_LIB_FOLDER = "lib"; + private final SetProperty modules; + private final Property platform; - private JavaFXPlatform platform; private String version = "17"; private String sdk; private String[] configurations = new String[] { "implementation" }; - private List modules = new ArrayList<>(); private FlatDirectoryArtifactRepository customSDKArtifactRepository; private final SourceSetContainer sourceSets; @@ -80,11 +81,18 @@ abstract public class JavaFXOptions { public JavaFXOptions(SourceSetContainer sourceSets, OsDetector osDetector) { this.sourceSets = sourceSets; - platform = JavaFXPlatform.detect(osDetector); + platform = getObjects().property(JavaFXPlatform.class); + getFxPlatform().convention(JavaFXPlatform.detect(osDetector)); setClasspathAttributesForAllSourceSets(); + modules = getObjects().setProperty(String.class); } + public JavaFXPlatform getPlatform() { + return getFxPlatform().get(); + } + + public Property getFxPlatform(){ return platform; } @@ -94,7 +102,7 @@ public JavaFXPlatform getPlatform() { * Supported classifiers are linux, linux-aarch64, win/windows, osx/mac/macos or osx-aarch64/mac-aarch64/macos-aarch64. */ public void setPlatform(String platform) { - this.platform = JavaFXPlatform.fromString(platform); + this.getFxPlatform().set(JavaFXPlatform.fromString(platform)); setClasspathAttributesForAllSourceSets(); } @@ -108,10 +116,10 @@ private void setClasspathAttributesForAllSourceSets() { private void setClasspathAttributes(Configuration classpath) { classpath.getAttributes().attribute( OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, - getObjects().named(OperatingSystemFamily.class, platform.getOsFamily())); + getObjects().named(OperatingSystemFamily.class, platform.get().getOsFamily())); classpath.getAttributes().attribute( MachineArchitecture.ARCHITECTURE_ATTRIBUTE, - getObjects().named(MachineArchitecture.class, platform.getArch())); + getObjects().named(MachineArchitecture.class, platform.get().getArch())); } public String getVersion() { @@ -168,12 +176,17 @@ public String[] getConfigurations() { return configurations; } - public List getModules() { + public SetProperty getFxModules() { return modules; } + public Set getModules() { + return modules.get(); + } + public void setModules(List modules) { - this.modules = modules; + this.modules.set(modules); + } public void modules(String...moduleNames) { @@ -190,7 +203,7 @@ private void declareFXDependencies(String conf) { return; } - var javaFXModules = JavaFXModule.getJavaFXModules(this.modules); + var javaFXModules = JavaFXModule.getJavaFXModules(getModules()); if (customSDKArtifactRepository == null) { javaFXModules.stream() .sorted() diff --git a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java index 47f040c..c86fbf7 100644 --- a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java +++ b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java @@ -38,6 +38,8 @@ import org.gradle.api.file.FileCollection; import org.gradle.api.plugins.ApplicationPlugin; import org.gradle.api.plugins.JavaBasePlugin; +import org.gradle.api.provider.Property; +import org.gradle.api.provider.SetProperty; import org.gradle.api.tasks.JavaExec; import org.gradle.api.tasks.SourceSetContainer; import org.gradle.util.GradleVersion; @@ -57,7 +59,6 @@ public void apply(Project project) { if (GradleVersion.current().compareTo(GradleVersion.version("6.1")) < 0) { throw new GradleException("This plugin requires Gradle 6.1+"); } - // Make sure 'java-base' is applied first, which makes the 'SourceSetContainer' available. // More concrete Java plugins that build on top of 'java-base' – like 'java-library' or 'application' – // will be applied by the user. @@ -91,12 +92,15 @@ public void apply(Project project) { return; // a module, as determined by Gradle core } - execTask.doFirst(a -> { - if (execTask.getExtensions().findByName("moduleOptions") != null) { - return; // a module, as determined by modularity plugin - } - putJavaFXJarsOnModulePathForClasspathApplication(execTask, javaFXOptions); + final var fxPlatform = javaFXOptions.getFxPlatform(); + final var fxModules = javaFXOptions.getFxModules(); + if (execTask.getExtensions().findByName("moduleOptions") != null) { + return; + } + + execTask.doFirst(a -> { + putJavaFXJarsOnModulePathForClasspathApplication(execTask, fxPlatform, fxModules); }); }); }); @@ -107,15 +111,15 @@ public void apply(Project project) { * the classpath. Hence, this patches the setup of Gradle's standard ':run' task to move all JavaFX Jars * from '-classpath' to '-module-path'. This functionality is only relevant for NON-MODULAR apps. */ - private static void putJavaFXJarsOnModulePathForClasspathApplication(JavaExec execTask, JavaFXOptions javaFXOptions) { + private static void putJavaFXJarsOnModulePathForClasspathApplication(JavaExec execTask, final Property platform, final SetProperty stringSetProperty) { FileCollection classpath = execTask.getClasspath(); - execTask.setClasspath(classpath.filter(jar -> !isJavaFXJar(jar, javaFXOptions.getPlatform()))); - var modulePath = classpath.filter(jar -> isJavaFXJar(jar, javaFXOptions.getPlatform())); + execTask.setClasspath(classpath.filter(jar -> !isJavaFXJar(jar, platform.get()))); + var modulePath = classpath.filter(jar -> isJavaFXJar(jar, platform.get())); execTask.getJvmArgumentProviders().add(() -> List.of( "--module-path", modulePath.getAsPath(), - "--add-modules", String.join(",", javaFXOptions.getModules()) + "--add-modules", String.join(",", stringSetProperty.get()) )); } From c666b42abdd381c79dfff4255b6fc9aab2f0c1f3 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Thu, 15 May 2025 12:02:53 +0200 Subject: [PATCH 02/13] step 1 make old tests run again Signed-off-by: Thorsten --- src/main/java/org/openjfx/gradle/JavaFXPlugin.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java index c86fbf7..6498851 100644 --- a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java +++ b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java @@ -95,11 +95,12 @@ public void apply(Project project) { final var fxPlatform = javaFXOptions.getFxPlatform(); final var fxModules = javaFXOptions.getFxModules(); - if (execTask.getExtensions().findByName("moduleOptions") != null) { - return; - } + execTask.doFirst(a -> { + if (a.getExtensions().findByName("moduleOptions") != null) { + return; + } putJavaFXJarsOnModulePathForClasspathApplication(execTask, fxPlatform, fxModules); }); }); From 813189d2e15aed03de86c3d5ac7bd118fb865adf Mon Sep 17 00:00:00 2001 From: Thorsten Date: Thu, 15 May 2025 13:46:46 +0200 Subject: [PATCH 03/13] wip its odd Signed-off-by: Thorsten --- .../java/org/openjfx/gradle/JavaFXPlugin.java | 48 +++++++++++-------- .../openjfx/gradle/JavaFXPluginSmokeTest.java | 17 ++++++- .../JavaFXPluginSmokeTestGradle814.java | 38 +++++++++++++++ .../gradle/JavaFXPluginSmokeTestGradle83.java | 2 + .../gradle/JavaFXPluginSmokeTestGradle87.java | 40 ++++++++++++++++ .../JavaFXPluginSmokeTestGradle87CC.java | 43 +++++++++++++++++ 6 files changed, 166 insertions(+), 22 deletions(-) create mode 100644 src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814.java create mode 100644 src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87.java create mode 100644 src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87CC.java diff --git a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java index 6498851..d512a7b 100644 --- a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java +++ b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java @@ -31,10 +31,7 @@ import com.google.gradle.osdetector.OsDetector; import com.google.gradle.osdetector.OsDetectorPlugin; -import org.gradle.api.GradleException; -import org.gradle.api.NonNullApi; -import org.gradle.api.Plugin; -import org.gradle.api.Project; +import org.gradle.api.*; import org.gradle.api.file.FileCollection; import org.gradle.api.plugins.ApplicationPlugin; import org.gradle.api.plugins.JavaBasePlugin; @@ -84,27 +81,36 @@ public void apply(Project project) { // and other Java-base plugins like Kotlin JVM) project.getPlugins().withId("java", p -> javaFXOptions.setConfiguration("implementation")); - // Only do addition configuration of the ':run' task when the 'application' plugin is applied. - // Otherwise, that task does not exist. - project.getPlugins().withId("application", p -> { - project.getTasks().named(ApplicationPlugin.TASK_RUN_NAME, JavaExec.class, execTask -> { - if (GradleVersion.current().compareTo(GradleVersion.version("6.4")) >= 0 && execTask.getMainModule().isPresent()) { - return; // a module, as determined by Gradle core + project.afterEvaluate(new Action() { + @Override + public void execute(Project project) { + System.out.println("project = " + project); + if (!project.getPlugins().hasPlugin("application") || project.getPlugins().hasPlugin("org.javamodularity.moduleplugin")) { + return; } - - - final var fxPlatform = javaFXOptions.getFxPlatform(); - final var fxModules = javaFXOptions.getFxModules(); - - - execTask.doFirst(a -> { - if (a.getExtensions().findByName("moduleOptions") != null) { - return; + System.out.println("project2 = " + project); + project.getTasks().named("run", JavaExec.class, new Action() { + @Override + public void execute(JavaExec task) { + if (true) { + throw new RuntimeException("test"); + } + System.out.println("project3 = " + project); + if (GradleVersion.current().compareTo(GradleVersion.version("6.4")) >= 0 &&task.getMainModule().isPresent()) { + return; + } + final var fxPlatform = javaFXOptions.getFxPlatform(); + final var fxModules = javaFXOptions.getFxModules(); + System.out.println("project3 = " + fxModules); + task.doFirst(a -> { + putJavaFXJarsOnModulePathForClasspathApplication(task, fxPlatform, fxModules); + }); } - putJavaFXJarsOnModulePathForClasspathApplication(execTask, fxPlatform, fxModules); }); - }); + + } }); + } /** diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java index a94d96f..68d9281 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java @@ -37,6 +37,7 @@ import java.io.File; import java.lang.management.ManagementFactory; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @@ -90,6 +91,7 @@ void smokeTestNonModular() { var result = build(":non-modular:run"); assertEquals(TaskOutcome.SUCCESS, result.task(":non-modular:run").getOutcome()); + System.out.println("result.getOutput() = " + result.getOutput()); assertEquals(List.of("javafx-base-17-" + classifier + ".jar", "javafx-controls-17-" + classifier + ".jar", "javafx-graphics-17-" + classifier + ".jar", "javafx-media-17-" + classifier + ".jar", "javafx-web-17-" + classifier + ".jar"), compileClassPath(result).get(0)); assertEquals(List.of("main", "main"), runtimeClassPath(result).get(0)); @@ -149,7 +151,20 @@ private BuildResult build(String task) { .withGradleVersion(getGradleVersion()) .withPluginClasspath() .withDebug(ManagementFactory.getRuntimeMXBean().getInputArguments().toString().contains("-agentlib:jdwp")) - .withArguments("clean", task, "--stacktrace", "--debug") + .withArguments(getGradleRunnerArguments(task)) .build(); } + + protected List getGradleRunnerArguments(String taskname) { + final var args = new ArrayList(List.of("clean", taskname, "--stacktrace", "--info")); + if (useConfigurationCache()) { + args.add("--configuration-cache"); + } + return args; + + } + + protected boolean useConfigurationCache() { + return false; + } } diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814.java new file mode 100644 index 0000000..ca7ddbb --- /dev/null +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2023, Gluon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.openjfx.gradle; + +class JavaFXPluginSmokeTestGradle814 extends JavaFXPluginSmokeTest { + + @Override + protected String getGradleVersion() { + return "8.14"; + } +} diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java index 5a47043..86b6086 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java @@ -35,4 +35,6 @@ class JavaFXPluginSmokeTestGradle83 extends JavaFXPluginSmokeTest { protected String getGradleVersion() { return "8.3"; } + + } diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87.java new file mode 100644 index 0000000..146663a --- /dev/null +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023, Gluon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.openjfx.gradle; + +class JavaFXPluginSmokeTestGradle87 extends JavaFXPluginSmokeTest { + + @Override + protected String getGradleVersion() { + return "8.7"; + } + + +} diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87CC.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87CC.java new file mode 100644 index 0000000..f54e39f --- /dev/null +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87CC.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023, Gluon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.openjfx.gradle; + +class JavaFXPluginSmokeTestGradle87CC extends JavaFXPluginSmokeTest { + + @Override + protected String getGradleVersion() { + return "8.7"; + } + + @Override + protected boolean useConfigurationCache() { + return true; + } +} From 0d4d0e953a4db3a96b7e3e99cc4542fd359531b0 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Thu, 15 May 2025 14:51:01 +0200 Subject: [PATCH 04/13] hurra it works again --- .../java/org/openjfx/gradle/JavaFXPlugin.java | 10 +---- .../openjfx/gradle/JavaFXPluginSmokeTest.java | 8 +++- .../JavaFXPluginSmokeTestGradle814CC.java | 43 +++++++++++++++++++ 3 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814CC.java diff --git a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java index d512a7b..4357e8d 100644 --- a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java +++ b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java @@ -84,24 +84,18 @@ public void apply(Project project) { project.afterEvaluate(new Action() { @Override public void execute(Project project) { - System.out.println("project = " + project); - if (!project.getPlugins().hasPlugin("application") || project.getPlugins().hasPlugin("org.javamodularity.moduleplugin")) { + if (!project.getPlugins().hasPlugin("application") || + (project.getPlugins().hasPlugin("org.javamodularity.moduleplugin")) && project.getExtensions().findByName("modulename") != null) { return; } - System.out.println("project2 = " + project); project.getTasks().named("run", JavaExec.class, new Action() { @Override public void execute(JavaExec task) { - if (true) { - throw new RuntimeException("test"); - } - System.out.println("project3 = " + project); if (GradleVersion.current().compareTo(GradleVersion.version("6.4")) >= 0 &&task.getMainModule().isPresent()) { return; } final var fxPlatform = javaFXOptions.getFxPlatform(); final var fxModules = javaFXOptions.getFxModules(); - System.out.println("project3 = " + fxModules); task.doFirst(a -> { putJavaFXJarsOnModulePathForClasspathApplication(task, fxPlatform, fxModules); }); diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java index 68d9281..a4944b9 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java @@ -33,6 +33,7 @@ import org.gradle.testkit.runner.BuildResult; import org.gradle.testkit.runner.GradleRunner; import org.gradle.testkit.runner.TaskOutcome; +import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Test; import java.io.File; @@ -75,6 +76,7 @@ void smokeTestModular() { @Test void smokeTestModularWithModularityPlugin() { + Assumptions.assumeFalse(useConfigurationCache(), "modularity plugin does not support configuration cache"); var result = build(":modular-with-modularity-plugin:run"); assertEquals(TaskOutcome.SUCCESS, result.task(":modular-with-modularity-plugin:run").getOutcome()); @@ -137,7 +139,8 @@ private static List> path(BuildResult result, String pathArg) { return result.getOutput().lines().filter(l -> l.contains(pathArg)).map(l -> { int pathArgIndex = l.indexOf(pathArg) + pathArg.length(); String pathString = l.substring(pathArgIndex, l.indexOf(" ", pathArgIndex)); - if (pathString.isBlank()) { + //recently gradle added an empty classpath instead of omitting it entirely which seems like the same thing? + if (pathString.isBlank() || pathString.equals("\"\"")) { return List.of(); } String[] path = pathString.split(System.getProperty("path.separator")); @@ -156,7 +159,8 @@ private BuildResult build(String task) { } protected List getGradleRunnerArguments(String taskname) { - final var args = new ArrayList(List.of("clean", taskname, "--stacktrace", "--info")); + //note that the tests are written around --debug, they will fail if you reduce logging + final var args = new ArrayList(List.of("clean", taskname, "--stacktrace", "--debug")); if (useConfigurationCache()) { args.add("--configuration-cache"); } diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814CC.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814CC.java new file mode 100644 index 0000000..ed53001 --- /dev/null +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814CC.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023, Gluon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.openjfx.gradle; + +class JavaFXPluginSmokeTestGradle814CC extends JavaFXPluginSmokeTest { + + @Override + protected String getGradleVersion() { + return "8.14"; + } + + @Override + protected boolean useConfigurationCache() { + return true; + } +} From f6f8627302b8f34355311587294359175e8f358d Mon Sep 17 00:00:00 2001 From: Thorsten Date: Thu, 15 May 2025 14:56:16 +0200 Subject: [PATCH 05/13] remove debug --- src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java index a4944b9..f008c2d 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java @@ -93,7 +93,6 @@ void smokeTestNonModular() { var result = build(":non-modular:run"); assertEquals(TaskOutcome.SUCCESS, result.task(":non-modular:run").getOutcome()); - System.out.println("result.getOutput() = " + result.getOutput()); assertEquals(List.of("javafx-base-17-" + classifier + ".jar", "javafx-controls-17-" + classifier + ".jar", "javafx-graphics-17-" + classifier + ".jar", "javafx-media-17-" + classifier + ".jar", "javafx-web-17-" + classifier + ".jar"), compileClassPath(result).get(0)); assertEquals(List.of("main", "main"), runtimeClassPath(result).get(0)); From 4583eb3fbe43ccdd24d9fd618c8275af09f23d0c Mon Sep 17 00:00:00 2001 From: Thorsten Date: Thu, 15 May 2025 15:06:49 +0200 Subject: [PATCH 06/13] cleanup --- .../java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java index 86b6086..5a47043 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java @@ -35,6 +35,4 @@ class JavaFXPluginSmokeTestGradle83 extends JavaFXPluginSmokeTest { protected String getGradleVersion() { return "8.3"; } - - } From 994df37bb342f465ed97301b34bbd72419e8d57d Mon Sep 17 00:00:00 2001 From: Thorsten Date: Thu, 15 May 2025 15:44:05 +0200 Subject: [PATCH 07/13] reproducers test --- .../java/org/openjfx/gradle/JavaFXPlugin.java | 7 +++ .../gradle/JavaFXPluginSmokeTestGradle63.java | 50 +++++++++++++++++++ .../gradle/JavaFXPluginSmokeTestGradle64.java | 40 +++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle63.java create mode 100644 src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle64.java diff --git a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java index 4357e8d..a8e439b 100644 --- a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java +++ b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java @@ -43,6 +43,7 @@ import org.openjfx.gradle.metadatarule.JavaFXComponentMetadataRule; import java.io.File; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -81,6 +82,7 @@ public void apply(Project project) { // and other Java-base plugins like Kotlin JVM) project.getPlugins().withId("java", p -> javaFXOptions.setConfiguration("implementation")); + project.afterEvaluate(new Action() { @Override public void execute(Project project) { @@ -88,9 +90,14 @@ public void execute(Project project) { (project.getPlugins().hasPlugin("org.javamodularity.moduleplugin")) && project.getExtensions().findByName("modulename") != null) { return; } + System.out.println("project = " + new ArrayList<>(project.getPlugins())); + System.out.println("project = " + project.getPlugins().hasPlugin("org.javamodularity.moduleplugin")); + System.out.println("project = " + project.getExtensions().findByName("modulename")); + project.getTasks().named("run", JavaExec.class, new Action() { @Override public void execute(JavaExec task) { + System.out.println("project = " + project.getExtensions().findByName("modulename")); if (GradleVersion.current().compareTo(GradleVersion.version("6.4")) >= 0 &&task.getMainModule().isPresent()) { return; } diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle63.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle63.java new file mode 100644 index 0000000..4697197 --- /dev/null +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle63.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2023, Gluon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.openjfx.gradle; + +import org.junit.jupiter.api.Disabled; + +class JavaFXPluginSmokeTestGradle63 extends JavaFXPluginSmokeTest { + + @Override + protected String getGradleVersion() { + return "6.3"; + } + + @Override + protected String modularApplicationRuntime() { + return "main"; + } + + @Disabled + void smokeTestModular() { + // Support for building Java Modules was only added in Gradle 6.4 + } +} diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle64.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle64.java new file mode 100644 index 0000000..d1b39e0 --- /dev/null +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle64.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023, Gluon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.openjfx.gradle; + + +class JavaFXPluginSmokeTestGradle64 extends JavaFXPluginSmokeTest { + + @Override + protected String getGradleVersion() { + return "6.4"; + } + +} From 5508ac00bd994b66bd28619340a04a951a0a80e0 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Thu, 15 May 2025 15:45:03 +0200 Subject: [PATCH 08/13] cleanup --- src/main/java/org/openjfx/gradle/JavaFXPlugin.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java index a8e439b..338519f 100644 --- a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java +++ b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java @@ -90,14 +90,10 @@ public void execute(Project project) { (project.getPlugins().hasPlugin("org.javamodularity.moduleplugin")) && project.getExtensions().findByName("modulename") != null) { return; } - System.out.println("project = " + new ArrayList<>(project.getPlugins())); - System.out.println("project = " + project.getPlugins().hasPlugin("org.javamodularity.moduleplugin")); - System.out.println("project = " + project.getExtensions().findByName("modulename")); project.getTasks().named("run", JavaExec.class, new Action() { @Override public void execute(JavaExec task) { - System.out.println("project = " + project.getExtensions().findByName("modulename")); if (GradleVersion.current().compareTo(GradleVersion.version("6.4")) >= 0 &&task.getMainModule().isPresent()) { return; } From 20cdb117d32a0def42d8062ebfb7ec13a4aeeab2 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Thu, 15 May 2025 20:02:36 +0200 Subject: [PATCH 09/13] bump minimum required version 6.4 to not have to deal with broken evaluateLater --- .../java/org/openjfx/gradle/JavaFXPlugin.java | 6 +-- .../gradle/JavaFXPluginSmokeTestGradle61.java | 50 ------------------- .../gradle/JavaFXPluginSmokeTestGradle63.java | 50 ------------------- 3 files changed, 3 insertions(+), 103 deletions(-) delete mode 100644 src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle61.java delete mode 100644 src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle63.java diff --git a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java index 338519f..015bd39 100644 --- a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java +++ b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java @@ -54,8 +54,8 @@ public class JavaFXPlugin implements Plugin { @Override public void apply(Project project) { - if (GradleVersion.current().compareTo(GradleVersion.version("6.1")) < 0) { - throw new GradleException("This plugin requires Gradle 6.1+"); + if (GradleVersion.current().compareTo(GradleVersion.version("6.4")) < 0) { + throw new GradleException("This plugin requires Gradle 6.4+"); } // Make sure 'java-base' is applied first, which makes the 'SourceSetContainer' available. // More concrete Java plugins that build on top of 'java-base' – like 'java-library' or 'application' – @@ -94,7 +94,7 @@ public void execute(Project project) { project.getTasks().named("run", JavaExec.class, new Action() { @Override public void execute(JavaExec task) { - if (GradleVersion.current().compareTo(GradleVersion.version("6.4")) >= 0 &&task.getMainModule().isPresent()) { + if (task.getMainModule().isPresent()) { return; } final var fxPlatform = javaFXOptions.getFxPlatform(); diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle61.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle61.java deleted file mode 100644 index c8e4cb5..0000000 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle61.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2023, Gluon - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package org.openjfx.gradle; - -import org.junit.jupiter.api.Disabled; - -class JavaFXPluginSmokeTestGradle61 extends JavaFXPluginSmokeTest { - - @Override - protected String getGradleVersion() { - return "6.1"; - } - - @Override - protected String modularApplicationRuntime() { - return "main"; - } - - @Disabled - void smokeTestModular() { - // Support for building Java Modules was only added in Gradle 6.4 - } -} diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle63.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle63.java deleted file mode 100644 index 4697197..0000000 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle63.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2023, Gluon - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package org.openjfx.gradle; - -import org.junit.jupiter.api.Disabled; - -class JavaFXPluginSmokeTestGradle63 extends JavaFXPluginSmokeTest { - - @Override - protected String getGradleVersion() { - return "6.3"; - } - - @Override - protected String modularApplicationRuntime() { - return "main"; - } - - @Disabled - void smokeTestModular() { - // Support for building Java Modules was only added in Gradle 6.4 - } -} From e89eb61c0653c92474909d8436fa854e6c750a9e Mon Sep 17 00:00:00 2001 From: Thorsten Date: Fri, 23 May 2025 12:48:52 +0200 Subject: [PATCH 10/13] Replace with Singular imports as required by review --- src/main/java/org/openjfx/gradle/JavaFXModule.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/openjfx/gradle/JavaFXModule.java b/src/main/java/org/openjfx/gradle/JavaFXModule.java index a412329..51d570f 100644 --- a/src/main/java/org/openjfx/gradle/JavaFXModule.java +++ b/src/main/java/org/openjfx/gradle/JavaFXModule.java @@ -31,7 +31,11 @@ import org.gradle.api.GradleException; -import java.util.*; +import java.util.Collection; +import java.util.List; +import java.util.Locale; +import java.util.Optional; +import java.util.Set; import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; From 316acc320bebe40d55fbadc112404d2bdd1dbb02 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Fri, 23 May 2025 12:53:47 +0200 Subject: [PATCH 11/13] Update copyright in new files as required by review --- .../java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle64.java | 2 +- .../java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814.java | 2 +- .../org/openjfx/gradle/JavaFXPluginSmokeTestGradle814CC.java | 2 +- .../java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java | 2 +- .../java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87.java | 2 +- .../org/openjfx/gradle/JavaFXPluginSmokeTestGradle87CC.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle64.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle64.java index d1b39e0..67b5847 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle64.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle64.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Gluon + * Copyright (c) 2025, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814.java index ca7ddbb..911c353 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Gluon + * Copyright (c) 2025, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814CC.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814CC.java index ed53001..94dc3d6 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814CC.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle814CC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Gluon + * Copyright (c) 2025, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java index 5a47043..dcdbe31 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Gluon + * Copyright (c) 2025, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87.java index 146663a..2c31159 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Gluon + * Copyright (c) 2025, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87CC.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87CC.java index f54e39f..92f6e27 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87CC.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle87CC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Gluon + * Copyright (c) 2025, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without From 7222756d8378fa4fdd7402d57bad942edce867d6 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Fri, 23 May 2025 12:58:27 +0200 Subject: [PATCH 12/13] Update copyright in existing files as required by review --- src/main/java/org/openjfx/gradle/JavaFXModule.java | 2 +- src/main/java/org/openjfx/gradle/JavaFXOptions.java | 2 +- src/main/java/org/openjfx/gradle/JavaFXPlatform.java | 2 +- src/main/java/org/openjfx/gradle/JavaFXPlugin.java | 2 +- .../gradle/metadatarule/JavaFXComponentMetadataRule.java | 2 +- src/test/java/org/openjfx/gradle/JavaFXModuleTest.java | 2 +- src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java | 2 +- .../java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle69.java | 2 +- .../java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle76.java | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/openjfx/gradle/JavaFXModule.java b/src/main/java/org/openjfx/gradle/JavaFXModule.java index 51d570f..949384d 100644 --- a/src/main/java/org/openjfx/gradle/JavaFXModule.java +++ b/src/main/java/org/openjfx/gradle/JavaFXModule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Gluon + * Copyright (c) 2018, 2025, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/main/java/org/openjfx/gradle/JavaFXOptions.java b/src/main/java/org/openjfx/gradle/JavaFXOptions.java index c48a296..d6cc6b3 100644 --- a/src/main/java/org/openjfx/gradle/JavaFXOptions.java +++ b/src/main/java/org/openjfx/gradle/JavaFXOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Gluon + * Copyright (c) 2018, 2025, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/main/java/org/openjfx/gradle/JavaFXPlatform.java b/src/main/java/org/openjfx/gradle/JavaFXPlatform.java index a424a43..d6fc759 100644 --- a/src/main/java/org/openjfx/gradle/JavaFXPlatform.java +++ b/src/main/java/org/openjfx/gradle/JavaFXPlatform.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Gluon + * Copyright (c) 2018, 2025, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java index 015bd39..3d4f092 100644 --- a/src/main/java/org/openjfx/gradle/JavaFXPlugin.java +++ b/src/main/java/org/openjfx/gradle/JavaFXPlugin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Gluon + * Copyright (c) 2018, 2025, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/main/java/org/openjfx/gradle/metadatarule/JavaFXComponentMetadataRule.java b/src/main/java/org/openjfx/gradle/metadatarule/JavaFXComponentMetadataRule.java index f69dc99..e6704fa 100644 --- a/src/main/java/org/openjfx/gradle/metadatarule/JavaFXComponentMetadataRule.java +++ b/src/main/java/org/openjfx/gradle/metadatarule/JavaFXComponentMetadataRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Gluon + * Copyright (c) 2018, 2025, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/test/java/org/openjfx/gradle/JavaFXModuleTest.java b/src/test/java/org/openjfx/gradle/JavaFXModuleTest.java index 4bc58bc..ff19725 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXModuleTest.java +++ b/src/test/java/org/openjfx/gradle/JavaFXModuleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Gluon + * Copyright (c) 2018, 2025, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java index f008c2d..5a3289d 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Gluon + * Copyright (c) 2018, 2025, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle69.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle69.java index cc85100..20e289d 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle69.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle69.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Gluon + * Copyright (c) 2018, 2025, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle76.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle76.java index 11d893b..1e11b73 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle76.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle76.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Gluon + * Copyright (c) 2018, 2025, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without From d9f6c4f0bc180de2b82c898fccae2ca9e3750f1f Mon Sep 17 00:00:00 2001 From: Abhinay Agarwal Date: Mon, 26 May 2025 13:24:14 +0530 Subject: [PATCH 13/13] remove license changes from unchanged files --- .../gradle/metadatarule/JavaFXComponentMetadataRule.java | 2 +- src/test/java/org/openjfx/gradle/JavaFXModuleTest.java | 2 +- .../java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle69.java | 2 +- .../java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle76.java | 2 +- .../java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/openjfx/gradle/metadatarule/JavaFXComponentMetadataRule.java b/src/main/java/org/openjfx/gradle/metadatarule/JavaFXComponentMetadataRule.java index e6704fa..f69dc99 100644 --- a/src/main/java/org/openjfx/gradle/metadatarule/JavaFXComponentMetadataRule.java +++ b/src/main/java/org/openjfx/gradle/metadatarule/JavaFXComponentMetadataRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Gluon + * Copyright (c) 2023, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/test/java/org/openjfx/gradle/JavaFXModuleTest.java b/src/test/java/org/openjfx/gradle/JavaFXModuleTest.java index ff19725..4bc58bc 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXModuleTest.java +++ b/src/test/java/org/openjfx/gradle/JavaFXModuleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Gluon + * Copyright (c) 2018, 2023, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle69.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle69.java index 20e289d..cc85100 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle69.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle69.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Gluon + * Copyright (c) 2023, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle76.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle76.java index 1e11b73..11d893b 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle76.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle76.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Gluon + * Copyright (c) 2023, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java index dcdbe31..5a47043 100644 --- a/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java +++ b/src/test/java/org/openjfx/gradle/JavaFXPluginSmokeTestGradle83.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Gluon + * Copyright (c) 2023, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without