diffplug / spotless

Keep your code spotless
Apache License 2.0
4.49k stars 455 forks source link

Support Gradle Project Isolation #1979

Open ZacSweers opened 9 months ago

ZacSweers commented 9 months ago

Gradle 8.5, Spotless Gradle plugin 6.23.3, macOS Sonoma 14.2.1

Project isolation is coming down the pipeline in Gradle and adds new limitations

https://gradle.github.io/configuration-cache/#status_as_of_gradle_8_5

This fails within spotless here

org.gradle.api.InvalidUserCodeException: Project ':app' cannot dynamically look up a property in the parent project ':'
    ...
    at org.gradle.api.internal.project.DefaultProject.hasProperty(DefaultProject.java:1175)
    at com.diffplug.gradle.spotless.SpotlessExtensionImpl.createFormatTasks(SpotlessExtensionImpl.java:51)
    at com.diffplug.gradle.spotless.SpotlessExtension.maybeCreate(SpotlessExtension.java:262)
    at com.diffplug.gradle.spotless.SpotlessExtension.format(SpotlessExtension.java:246)
    at com.diffplug.gradle.spotless.SpotlessExtension.format(SpotlessExtension.java:224)

Specifically, Project.getProperty/Project.hasProperty look like they need to be replaced with provider APIs instead.

ZacSweers commented 9 months ago

Quick note: I'm aware of #987 and #1274, just dropping a separate issue for this specific issue!