Skip to content

Commit 8465d5d

Browse files
authored
Merge pull request #9 from openjavaformat/gradle-configuration-cache
Say the Gradle plugin works with the configuration cache
2 parents 0fa5d71 + 6300aa8 commit 8465d5d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎docs/get-started/gradle.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,22 @@ is resolved by the root project, so the root project needs the repository too.
115115
}
116116
```
117117

118+
## Configuration cache
119+
120+
The plugin works with Gradle's configuration cache: `formatDiff`, the [Spotless](spotless.md) step
121+
and the IntelliJ IDEA tasks below run from a cached configuration, and the next build reuses it.
122+
Turn the cache on as for any build:
123+
124+
``` properties title="gradle.properties"
125+
org.gradle.configuration-cache=true
126+
```
127+
128+
Up to 21.0.1, `formatDiff` and the Spotless step fail with the cache on
129+
([#193](https://github.com/openjavaformat/open-java-format/issues/193)).
130+
131+
Gradle's own `idea` task does not support the cache, and Gradle turns it off for a build that runs
132+
the task.
133+
118134
## IntelliJ IDEA
119135

120136
When the project is opened in IntelliJ IDEA, the plugin writes the formatter settings into `.idea`,

0 commit comments

Comments
 (0)