Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin not working, starting with Gradle 7.5 #140

Open
FlorianKirmaier opened this issue Jan 15, 2023 · 3 comments
Open

Plugin not working, starting with Gradle 7.5 #140

FlorianKirmaier opened this issue Jan 15, 2023 · 3 comments

Comments

@FlorianKirmaier
Copy link
Contributor

FlorianKirmaier commented Jan 15, 2023

According to my test (in 1 project),
the dependencies are no longer added with version 7.5 or 7.6.
It does work with 7.4.

There is no error, just the dependencies are not added.

Edit: Yesterday I was able to reproduce/not reproduce it, by switching the versions. For some reason that doesn't work today. So I don't know exactly whats happening, maybe some sort of caching? Guess I will watch out for it.
As far as I've checked, they did quite some changes to the dependency resolution in 7.5.

@raoulsson
Copy link

I really need this so I patched together a temporary fix here: https://github.com/raoulsson/javafx-gradle-plugin. If it works, make sure to switch back to the original, once the next working release is out.

@NotStirred
Copy link

NotStirred commented Apr 2, 2023

As far as I can tell there are no relevant code changes here @raoulsson could you point me to it?

It seems like gradle's changes to dependency resolution in 7.5 have broken something with adding dependencies to a project within a plugin. Latest (currently 8.0.2) also has the same issue.

Either the API has changed without any warning or there's a bug somewhere

@NotStirred
Copy link

After a lot of reading - the fix is to put modules at the bottom of the extension block:
Before:

javafx {
    version = '11.0.2'
    modules = ['javafx.base', 'javafx.controls', 'javafx.fxml']
    configuration = 'implementation'
}

After:

javafx {
    version = '11.0.2'
    configuration = 'implementation'
    modules = ['javafx.base', 'javafx.controls', 'javafx.fxml']
}

This is because any change to the extension calls updateJavaFXDependencies, which immediately calls clearJavaFXDependencies removing the previously added modules.

leMaik pushed a commit to chunky-dev/chunky that referenced this issue Apr 4, 2023
* Upgrade Gradle 7.4 -> 7.5

* Update to gradle 8.0.2

* Work around extension issue in javafx plugin openjfx/javafx-gradle-plugin#140

* updated Gradle plugins, removed unnecessary compile flag override

---------

Co-authored-by: Tom Martin <[email protected]>
leMaik pushed a commit to leMaik/chunky that referenced this issue Sep 9, 2023
* Upgrade Gradle 7.4 -> 7.5

* Update to gradle 8.0.2

* Work around extension issue in javafx plugin openjfx/javafx-gradle-plugin#140

* updated Gradle plugins, removed unnecessary compile flag override

---------

Co-authored-by: Tom Martin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants