Add harness to allow smooth transition for 5.x by nedtwigg · Pull Request #598 · diffplug/spotless

We currently support all the way back to Gradle 2.x. As identified in #504, that will not be possible for much longer, so it's time for us to adopt all the latest and greatest. As part of that transition, it's a good opportunity to do some intentional breaking changes (e.g. remove deprecated APIs).

To enable us to make the 5.x jump without a long-lived feature branch, this PR extracts all non-deprecated behavior into SpotlessTaskBase and SpotlessExtensionBase. It then introduces SpotlessTaskModern, SpotlessExtensionModern, and SpotlessPluginModern (69f7d26). These are then implemented by copy-pasting the old legacy implementations in. This PR also introduces a new task :plugin-gradle:modernTest, which runs all of the plugin-gradle integration tests, but against SpotlessPluginModern rather than against SpotlessPlugin (b8282ae).

If users want to use the new modern implementations in a real project, they can use -PspotlessModern. However, we don't commit to API stability on this until it is actually released.