-
Notifications
You must be signed in to change notification settings - Fork 461
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
Spotless plugin-gradle "modern" #600
Comments
Here's the list of autostyle changes that could qualify as breaking change enhancements: |
@nedtwigg The more I work with this approach, the less I feel like it's going to work. In order to really move to use the latest Gradle APIs, we'll want to switch the tasks and extensions to use Instead of trying to do this in a single branch, what do you think of using 2 different Git branches and publishing the 2 plugins separately? There will be a bit more overhead in keeping the branches in sync, and we'd need a second CI pipeline, but I think we can avoid making nasty compromises in the modern implementation. WDYT? |
@LifeIsStrange, as noted in #616, we already support incremental build and the build cache. @bigdaz I definitely don't want nasty compromises! How about if I am absolutely killing the old implementation, but I would like to have them parallel in the same source tree. Before releasing, I will do the following transformation:
But it's easier for me to understand and maintain your changes if I can review and test them parallel to the legacy implementation. I don't mean to burden you with the testing part of it though, feel free to dump that part on me. |
Thanks Ned. I understand your motivation, and I'll keep working to do the minimal amount of work so that we can avoid creating tasks eagerly. Yes, and this might involve removing the shared base class for certain types. At a later date you might want to change |
Feel free to break whatever you would like, including spotless/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessExtensionBase.java Lines 203 to 210 in 183c0b4
could become |
Released! Thanks for all the help @bigdaz. |
Currently, the plugin id for Spotless is
com.diffplug.gradle.spotless
and it is backward-compatible all the way to Gradle2.x
. Soon, it will cohabitate withcom.diffplug.spotless
, which will require Gradle5.4+
, drops all deprecated code, and adopts all latest-available Gradle APIs. If your build completes without warnings on the old id, then all you'll need to do is swap the new id with no further changes.It will probably be some weeks/months before
com.diffplug.spotless
is ready. In the meantime, if you specify-PspotlessModern=true
, then you'll be using the new plugin already. We are currently running our test suite using this flag, to ensure that the transition is seamless. (PR #598)The whole point of Spotless is that formatting doesn't matter, so it follows that code formatting tools really don't matter. This is a unique opportunity to drop confusing features, but anything that gets dropped needs to have a very clear migration path, or else we'll just keep supporting it at the new id, likely forever.
The text was updated successfully, but these errors were encountered: