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
Copy file name to clipboardexpand all lines: plugin-gradle/README.md
+4-11
Original file line number
Diff line number
Diff line change
@@ -70,10 +70,7 @@ spotless {
70
70
71
71
// Everything before the first #include or #pragma will
72
72
// be replaced with whatever is in `spotless.license.cpp`
73
-
licenseHeader {
74
-
headerFile 'spotless.license.cpp'
75
-
delimiter '#'
76
-
}
73
+
licenseHeaderFile 'spotless.license.cpp', '#'
77
74
}
78
75
}
79
76
```
@@ -314,18 +311,14 @@ The `licenseHeader` and `licenseHeaderFile` steps will generate license headers
314
311
`/* Licensed under Apache-2.0 1990-2003. */`
315
312
* the `$YEAR` token is otherwise missing
316
313
317
-
The separator for the year range defaults to the hyphen character, e.g `1990-2003`, but can be customized with the `yearSeparator` property using the block configuration syntax.
314
+
The separator for the year range defaults to the hyphen character, e.g `1990-2003`, but can be customized with the `yearSeparator` property.
315
+
318
316
For instance, the following configuration treats `1990, 2003` as a valid year range.
319
317
320
318
```gradle
321
319
spotless {
322
320
format java {
323
-
licenseHeader {
324
-
header 'Licensed under Apache-2.0 $YEAR'
325
-
headerFile 'path-to-file' // header and headerFile are exclusive
326
-
yearSeparator ', '
327
-
delimiter // Defaults to 'package' for Java, but can be customized here
328
-
}
321
+
licenseHeader(''Licensed under Apache-2.0 $YEAR').yearSeparator(', ')
0 commit comments