-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
Milestone
Description
Is there anyway to make the license checks a bit more relaxed? For instance, ignore parts of the template based on some condition / expression. We have a large number of source files which were created in 2018 with a header containing the copyright year as follows:
Copyright (c) Example, 2018. All rights reserved.
This is generated using the template
Copyright (c) Example, ${year}. All rights reserved.
Now starting 1/1/2019, all our builds are failing because the year in the file header does not match the current year. So we're left with two unattractive options now:
- Disable failing the build by setting
ignoreFailures = truebut this is a bit brute force and it doesn't fail the build when there are new files without license headers. - Update the year in every single source file which is not ideal and means every file in every project needs to have a new year at the beginning of every year.
My proposal is have a separate DSL for configuring the checks where we can specifically exclude certain variables from it. To start with, maybe something like:
license {
ext.year = LocalDate.now().year
sourceSets = [project.sourceSets.main]
+ checks {
+ ignoreVariables = ['year']
+ }
}Appreciate the time and effort you have put into this plugin.
jochenberger