Open Sporking opened 6 years ago
Have you tried https://github.com/openjfx/javafx-gradle-plugin ? This was specifically developed to simplify using JavaFX 11
Thanks for the pointer. I haven't tried the https://github.com/openjfx/javafx-gradle-plugin yet. It looks interesting, but I am wary.
Some positive things:
Some concerning things:
Of these issues, the one of greatest concern to me is the lack of detailed documentation as to what the plugin actually is supposed to do. Without a clear statement of what effects the plugin is expected to have on my Gradle script (what tasks it is supposed to modify the behavior of, and in what way, and how it will handle issues like .fxml files, etc.), I will have no effective way to determine whether or not the plugin is actually working correctly and/or meets my needs without reading its source code in depth. I will also have difficulty using it with other tools or plugins. Of course, if I was likely to fully understand what its source code is doing, I probably wouldn't have had as much trouble getting this to work as I already have (see above), and if it is omitting doing anything important, I won't be able to tell with my current level of knowledge. (Note that I have essentially the same complaint with other javafx plugins I have found, but most of them do provide at least a bit more documentation than this one does.)
From what little I can tell of it at the moment, the plugin seems like a promising start. I may take a little time to play with this and see if I can get it working, but I have already spent some time going down this road with other plugins, and have not yet had good results. I hope that the plugin improves soon (particularly with regards to its documentation) so that this seems more practical.
I have been struggling for several weeks (!) to get a previously working JavaFX application to build and run in a clean manner using:
I have encountered severe problems doing this, and at this point I have tried almost every idea I had as to how to accomplish it. Much googling has located for me a variety of fragments of Gradle scripts that accomplish one or two of these goals at a time, but which invariably are structured in such a way as to make the other goals difficult or impossible.
This should not be as difficult as it is, but lack of examples that use these items TOGETHER in a straightforward manner has made it an incredibly frustrating experience. For instance:
and so forth. Each of the above observations has involved many hours of googling and experimenting on my part to discover what was going on.
Granted, some of these are Gradle problems, and I will be filing some bug reports against Gradle in the near future, but at the same time, I have found that the documentation for how to use JavaFX with Gradle seems to be very lacking with regards to how to use the two together. Example scripts that use up-to-date JavaFX practices use out-of-date or deprecated Gradle practices, and vice versa. Assumptions are made as to whether or not .fxml files will be used in the project, whether Kotlin will be used, and so forth. This lack of good, clean, simple, complete, and well-supported examples is a severe impediment to using both Gradle and JavaFX.
I have scoured the internet searching for a single example that works and incorporates all of these items together and have so far not found a single one. I am hoping that someone on the JavaFX team who is more knowledgeable than I with JavaFX can provide some examples on the "Getting Started with JavaFX 11" page that will accomplish most if not all of these goals in a single self-consistent script.
My current code, which SOMEWHAT works, and which can perhaps be used as a starting point for documentation or can be mined for ideas, is as follows:
In summary, please modify your "Getting Started With JavaFX 11" examples page to provide a working example of a Gradle script that accomplishes these goals. Basically, I would like to see a "Hello, World" that is implemented using idiomatic Gradle, Kotlin, Java 9 modules, and JavaFX with .fxml files.
Thanks in advance.