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

Convert SpotlessTaskModern to use InputChanges API #607

Merged
merged 2 commits into from
Jun 11, 2020
Merged

Convert SpotlessTaskModern to use InputChanges API #607

merged 2 commits into from
Jun 11, 2020

Conversation

bigdaz
Copy link
Contributor

@bigdaz bigdaz commented Jun 8, 2020

This minimal change updates the task to use the non-deprecated
InputChanges API, making it compatible with an upcoming Gradle 7.0
release. This addresses one part of #601.

I haven't updated CHANGES.md since "spotlessModern" is not yet mentioned.

This minimal change updates the task to use the non-deprecated
`InputChanges` API, making it compatible with an upcoming Gradle 7.0
release.
@nedtwigg
Copy link
Member

nedtwigg commented Jun 8, 2020

Looks like ConfigAvoidanceTest is failing for the modern implementation. You can put @Category(ExcludeFromPluginGradleModern.class) on it, or you can detect this:

if ("true".equals(System.getProperty(SpotlessPluginModern.SPOTLESS_MODERN))) {

and change the test as necessary. Feel free to modify GradleIntegrationHarness as necessary if it makes testing easier.

@bigdaz
Copy link
Contributor Author

bigdaz commented Jun 8, 2020

I didn't have a chance to investigate: does it makes sense that this test fails?

Passes on JDK 11: https://scans.gradle.com/s/doieryq3v5kp6
Fails on JDK8: https://scans.gradle.com/s/ue2kfzw3ipgam

@nedtwigg
Copy link
Member

nedtwigg commented Jun 8, 2020

I would expect it to fail for both.

return gradleRunner().withGradleVersion(SpotlessPluginPreConfigAvoidance.CONFIG_AVOIDANCE_INTRODUCED.getVersion());

static final GradleVersion CONFIG_AVOIDANCE_INTRODUCED = GradleVersion.version("4.9");

and InputChanges was introduced in 5.4

@nedtwigg
Copy link
Member

Wow, what an elegant solution! This looks ready to merge to me, feel free to push merge whenever you'd like (or ask me if you'd prefer not to accept the committer invite I just sent you).

@bigdaz
Copy link
Contributor Author

bigdaz commented Jun 11, 2020

Thanks @nedtwigg. I've accepted your invite to the Diffplug org, but I want to state up front that I'm very unlikely to have capacity to stay involved in the development of Spotless long-term. My goal is to get the plugin into a good state and work well with the Gradle remote cache, then I'll probably disappear.

But it's certainly nice to be asked :).

@bigdaz bigdaz merged commit 7fb2333 into diffplug:master Jun 11, 2020
@bigdaz bigdaz deleted the dd/inputchanges branch June 11, 2020 23:35
@nedtwigg
Copy link
Member

Sounds great! Being a committer on the Spotless team comes with no duties, only privileges :) Now you can restart a failed CI job if you think it was flaky, merge-at-will, etc. If you can figure out how to make a project loosely-coupled (as we have for Spotless), then I think the ideas of OPEN open source are useful.

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