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
+31
Original file line number
Diff line number
Diff line change
@@ -273,6 +273,37 @@ spotless {
273
273
}
274
274
```
275
275
276
+
<aname="license-header"></a>
277
+
278
+
## License header options
279
+
280
+
If the string contents of a licenseHeader step or the file contents of a licenseHeaderFile step contains a $YEAR token,
281
+
then in the end-result generated license headers which use this license header as a template, $YEAR will be replaced with the current year.
282
+
283
+
284
+
For example:
285
+
```
286
+
/* Licensed under Apache-2.0 $YEAR. */
287
+
```
288
+
will produce
289
+
```
290
+
/* Licensed under Apache-2.0 2017. */
291
+
```
292
+
if Spotless is launched in 2017
293
+
294
+
295
+
The `licenseHeader` and `licenseHeaderFile` steps will generate license headers with automatic years from the base license header according to the following rules:
296
+
* A generated license header will be updated with the current year when
297
+
* the generated license header is missing
298
+
* the generated license header is not formatted correctly
299
+
* A generated license header will _not_ be updated when
300
+
* a single year is already present, e.g.
301
+
`/* Licensed under Apache-2.0 1990. */`
302
+
* a hyphen-separated year range is already present, e.g.
0 commit comments