You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I create a project that uses io.spring.javaformat and also the needed Boot and other plugins to support AOT compilation, then ./gradlew check and ./gradlew format fail. This ticket focuses on making ./gradlew format work.
The error is the following:
A problem was found with the configuration of task ':formatMain' (type 'Format').
- Gradle detected a problem with the following location: '/home/jzheaux/tmp/javaformat-aot/src/main/java'.
Reason: Task ':compileJava' uses this output of task ':formatMain' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Possible solutions:
1. Declare task ':formatMain' as an input of ':compileJava'.
2. Declare an explicit dependency on ':formatMain' from ':compileJava' using Task#dependsOn.
3. Declare an explicit dependency on ':formatMain' from ':compileJava' using Task#mustRunAfter.
You can see this by running ./gradlew format on the linked sample.
I can fix it by following the instructions from the Gradle error:
This isn't ideal, though, since I'd prefer to be able to run format and check independently from one another.
For additional context, this comes up in the Spring Security Samples project, where we use JavaFormat to keep the samples uniform. When we recently added an AOT sample, we ran into this behavior.
The text was updated successfully, but these errors were encountered:
I think this is really a duplicate of #425. Just as, ideally, Java Format wouldn't check AOT generated source, I also think that it shouldn't bother formatting it either. It feels like we need a mechanism by which Java Format can ignore the aot source set entirely.
If I create a project that uses
io.spring.javaformat
and also the needed Boot and other plugins to support AOT compilation, then./gradlew check
and./gradlew format
fail. This ticket focuses on making./gradlew format
work.The error is the following:
You can see this by running
./gradlew format
on the linked sample.I can fix it by following the instructions from the Gradle error:
This isn't ideal, though, since I'd prefer to be able to run
format
andcheck
independently from one another.For additional context, this comes up in the Spring Security Samples project, where we use JavaFormat to keep the samples uniform. When we recently added an AOT sample, we ran into this behavior.
The text was updated successfully, but these errors were encountered: