https://kotlinlang.org logo
a

andylamax

06/28/2020, 11:23 AM
How do I add tornadofx together with javafx dependency as a gradle dependency? I am having a problem with CI/CD in github actions. In my pc, I can build and test my code coz I have the javafx runtime. However in the testing vm,
javafx.event.EventTarget
appears to be missing. Help please . . .
c

Carlton Whitehead

06/28/2020, 2:27 PM
For consistency sake, I would suggest using a jdk without javafx locally
That will let you iterate faster and be a closer match to your CI/CD environment
Of course that brings up the issue of TornadoFX JDK > 8 compatibility, which is not yet complete, so your mileage may vary
a

andylamax

06/28/2020, 2:32 PM
I would use a jdk withut javafx locally, but some components of my lib depend on javafx
c

Carlton Whitehead

06/28/2020, 2:33 PM
That's why you add a dependency in your gradle build script, see the link above for the gradle syntax
a

andylamax

06/28/2020, 2:34 PM
Thank you, will get back to you incase something come up
c

Carlton Whitehead

06/28/2020, 2:36 PM
Another approach is to use a CI/CD environment with JDK 8 and javafx. I'm not sure how to do that with Github Actions. TornadoFX itself uses Travis CI, and its .travis.yml installs an Ubuntu package of openjfx on the build host prior to running its build. Perhaps a similar solution could work for GitHub Actions if you want to stick with a JDK 8
a

andylamax

06/28/2020, 2:40 PM
I like the 2nd approach much better, although I find it a bit tricky with github actions. Let me give it another go. One question though, in Travis CI, do you need to restart the vi or open aother terminal so that javafx can be picked up in the gradle build?
c

Carlton Whitehead

06/28/2020, 2:42 PM
a

andylamax

06/28/2020, 2:46 PM
gotcha
4 Views