sbt-header
sbt-header copied to clipboard
Add a simple `headerEndYear` key for configuring year ranges in license headers
We're big fans of sbt-header in sbt-typelevel and would like to upstream this change that we use in our projects. It is a simple scheme for specifying an optional headerEndYear. The range resolution is done in a very simplistic way, but it goes very far in our projects.
Namely, headerEndYear is None by default, but if provided and is greater than the startYear, a range of the following format is constructed:
startYear := Some(2021)
headerEndYear := Some(2022)
results in 2021-2022 as the year range, which is then inserted into the license header as the year. In any other case, the headerEndYear is simply ignored.
Opening this PR to jumpstart a discussion. I'm of course open to making this scheme more general and I'm looking forward to proposed improvements.
Thanks in advance.
A lot of the code is added in such a way that preserves both source and binary compatibility of builds.
Nice contribution! Thanks!