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

#609 Support application mainClass property as fallback of mainClassName #612

Merged
merged 2 commits into from
Feb 21, 2021
Merged

#609 Support application mainClass property as fallback of mainClassName #612

merged 2 commits into from
Feb 21, 2021

Conversation

nhumblot
Copy link
Contributor

@nhumblot nhumblot commented Nov 8, 2020

Fix #609

Hello,

Starting from Gradle 6.7, application.mainClassName property is deprecated. application.mainClass (introduced in Gradle 6.4) is the property to use.

The goal of this pull request is to allow projects using shadow plugin to transition to this new property. This change has been done to be non breaking by still picking first mainClassName and using mainClass as a fall-back.

This way, older configurations with mainClassName will still works as previously, but newer configurations with mainClass will also works.

One thing to note. This change won't produce an error for newer configurations any more. It won't produce a warning while the shadow plugin will be using Gradle 6.6.

It will still produce a warning when the shadow plugin Gradle version is upgraded to 6.7. To prevent such warning, mainClass property has to be picked before mainClassName property, but that would apply a small change in the behaviour of the plugin.

If maintainers of this plugin prefer to perform directly a change that won't produce a warning in the latter case, I'm open to adapt this pull request.

Feel free to comment this pull request, I will adapt the code based on the received comments. Please note this is my first pull request on this plugin, and my first pull request on any Gradle plugin so apply any special care you would in such case.

Kind regards

Additional information:

edit: I'm sorry for the force push (with lease), the user was wrongly configured.

@vojkny
Copy link

vojkny commented Nov 28, 2020

can we get this merged?

@xeruf
Copy link

xeruf commented Dec 28, 2020

Also fixes #625
Please merge!

@xeruf
Copy link

xeruf commented Jan 25, 2021

@johnrengelman please 🙏

@kleini
Copy link

kleini commented Feb 16, 2021

Next one stumbling over this unsolved deprecation.

@johnrengelman johnrengelman added this to the 6.2 milestone Feb 21, 2021
@johnrengelman johnrengelman merged commit 7b68fdc into GradleUp:master Feb 21, 2021
@dinomite
Copy link

@johnrengelman Thanks!

@nhumblot nhumblot deleted the 609_support_application_mainClass branch March 6, 2021 15:17
NiccoMlt added a commit to NiccoMlt/sample-gradle-project that referenced this pull request Mar 26, 2021
waiting for fix from PR GradleUp/shadow#612 to be released in a new version of com.github.johnrengelman.shadow
NiccoMlt added a commit to NiccoMlt/sample-gradle-project that referenced this pull request Mar 26, 2021
waiting for fix from PR GradleUp/shadow#612 to be released in a new version of com.github.johnrengelman.shadow
NiccoMlt added a commit to NiccoMlt/sample-javafx-project that referenced this pull request Mar 26, 2021
waiting for fix from PR GradleUp/shadow#612 to be released in a new version of com.github.johnrengelman.shadow

(cherry picked from commit 4122bbf7fc8eaca494129dc65f3e380f331f6581)
@xeruf
Copy link

xeruf commented Mar 29, 2021

We also need a new release now ;)

FilippoGurioli pushed a commit to matteosusca/OOP21-Mtl-Shot that referenced this pull request May 20, 2022
waiting for fix from PR GradleUp/shadow#612 to be released in a new version of com.github.johnrengelman.shadow

(cherry picked from commit 4122bbf7fc8eaca494129dc65f3e380f331f6581)
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

Successfully merging this pull request may close these issues.

JavaApplication.setMainClassName(String) removal in Gradle 8.0
8 participants