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

Handle deprecated Gradle properties of "jar" and "war" task #124

Merged
merged 2 commits into from
Dec 22, 2019

Conversation

darxriggs
Copy link

@darxriggs darxriggs commented Dec 21, 2019

The following output was shown when running gradle help --warning-mode all for a Jenkins plugin that is based on this one:

The ... property has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the ... property instead.

This is to resolve these warnings.

Copy link

@sghill sghill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for these enhancements! I appreciate adding the fallback code to keep this plugin backwards-compatible. There are a couple things I'd like to have addressed before merging and getting this released.

Additionally, if you'd like to update the IntegrationSpec to ensure we're not shipping anything deprecated in the future, I think that would fit well with this change. I tried adding this locally and found dozens of tests failed for these two deprecated properties:

def setup() {
    projectDir.newFile('gradle.properties') << 'org.gradle.warning.mode=fail'
}

It uses Gradle's ability to fail on warnings so we'll notice these issues sooner.

…ension"

The following output was shown when running `gradle help --warning-mode all`
for a Jenkins plugin that is based on this one:

> The archiveName property has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the archiveFileName property instead.
> The extension property has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the archiveExtension property instead.

These new properties are implemented as `Property` instead of `String` now.
Therefore the `set()` calls.
This new property is implemented as `Property` instead of `String` now.
Therefore the `set()` call.
@darxriggs darxriggs force-pushed the deprecated-properties branch from e30f50f to 4158f7d Compare December 22, 2019 16:30
@darxriggs
Copy link
Author

Thanks for the very useful hints. I now spent some time on the issues after enabling org.gradle.warning.mode=fail as suggested.

Unfortunately I am not familiar enough with the plugin and all the changes/deprecations in Gradle regarding dependency resolution to prepare all the required changes.

I just added another commit which is about the "jar" task as this is well understood.

@darxriggs darxriggs changed the title Handle deprecated Gradle properties "archiveName" and "extension" Handle deprecated Gradle properties of "jar" and "war" task Dec 22, 2019
@sghill
Copy link

sghill commented Dec 22, 2019

This looks great, thanks for the quick turnaround!

Unfortunately I am not familiar enough with the plugin and all the changes/deprecations in Gradle regarding dependency resolution to prepare all the required changes.

No worries, 👍 for looking into it.

@sghill sghill merged commit 807d78e into jenkinsci:master Dec 22, 2019
@sghill
Copy link

sghill commented Dec 23, 2019

This has been released in 0.36.0.

@darxriggs darxriggs deleted the deprecated-properties branch December 23, 2019 08:50
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.

2 participants