-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix SpotlessPlugin.taskMustRunAfterClean
- Loading branch information
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5ee9046
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems to force eager task configuration for
spotlessJava
and friends whenclean
is configured, also due to another Gradle bug aroundclean
it means that the spotless tasks are always configured becauseclean
is always configured.. Was there a problem with the behaviour at spotless version 6.0.2? That seems like the sweet spot for my setup but maybe i'm living with a bug.gradle/gradle#19498
5ee9046
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, thanks! This PR is part of #1014, which was about removing the dependency on
BasePlugin
. But I think this particular commit was not a necessary change. I will revert it shortly.5ee9046
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out that reverting this commit actually does trigger a bug, but only if the
base
plugin has not been applied, which is usually a problem only for Android projects.We fixed this in #1068 which will ship in the next release. If you apply
base
before calling any Spotless stuff, then you'll get the old6.0.2
behavior again. Ifbase
hasn't been applied yet, then the change in this commit is necessary.5ee9046
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Released in
6.1.1
, lemme know if it fixes your issue.5ee9046
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep its fixed, thanks! amazing turnaround. There is one remaining difference between 6.0.2 and 6.1.1 in terms of eager task configuration, testable via
gw help --debug | grep Realize
on any project, 6.0.2 realised/creates only thehelp
task but6.1.1
also eagerly creates aspotlessInternalRegisterDependencies
task (just one tho), this is likely a separate issue/cause but worth mentioning 👍5ee9046
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Roger, thanks for the feedback. 👍