Open dgelessus opened 5 years ago
This problem looks to arise from the extra arguments only being added to the run task when the run task is executed. So those extra arguments are not sitting on the Task
object for other plugin authors to pick up.
This should be easy enough to fix if you are accepting PRs?
24 added support for non-modular projects (thank you!). This works fine when using the default
run
task provided by theapplication
plugin, but not for otherJavaExec
tasks (the necessary--module-path
and--add-modules
args are not added for them).This is a problem when using IntelliJ: if you run a class from IntelliJ (using an "Application" run configuration) in a Gradle-based project, IntelliJ creates and runs a
JavaExec
task on the fly based on the run configuration's settings. Since this is a new task and not the defaultrun
task, the additional arguments for OpenJFX are not added by the plugin.I would say that all
JavaExec
tasks should have the additional JVM arguments added, but that might have unintended effects on tasks that execute something non-JavaFX-related. Maybe the plugin should check which tasks have the OpenJFX jars in the classpath, and add the extra options only for those tasks?For now I've found two workarounds for this issue:
run
task. This way IntelliJ uses the predefined task instead of creating a new one.