Skip to content

Commit df698f1

Browse files
authored
Fix documentation for centralizing Spotless config
1 parent e8267b7 commit df698f1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

plugin-gradle/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,15 +1947,17 @@ If you want to centralize your Spotless configuration for use across many projec
19471947
If you are content with only centralizing configuration files, it is possible to define a common configuration that is deployed as a standard artifact so that it can be then be reused by each project. For example:
19481948
19491949
```kotlin
1950-
val spotlessConfig by configurations.creating
1950+
configurations {
1951+
spotlessConfig
1952+
}
19511953
dependencies {
19521954
// the files `java-import-order.txt` and `java-formatter.xml` should be at the root of the deployed `org.mycompany:code-configuration:1.0.0` jar.
19531955
spotlessConfig("org.mycompany:code-configuration:1.0.0")
19541956
}
19551957
spotless {
19561958
java {
19571959
removeUnusedImports()
1958-
importOrder(resources.text.fromArchiveEntry(spotlessConfig, "java-import-order.txt").asString())
1960+
importOrder(resources.text.fromArchiveEntry(configurations.spotlessConfig, "java-import-order.txt").asString())
19591961
eclipse().configXml(resources.text.fromArchiveEntry(spotlessConfig, "java-formatter.xml").asString())
19601962
}
19611963
}

0 commit comments

Comments
 (0)