Fix updateCopyrights Gradle task
* Do not modify files which already has an actual year in the Copyright * Make it to be performed really before any compilation, there change to `compileKotlin.dependsOn updateCopyrights`
This commit is contained in:
@@ -228,7 +228,7 @@ subprojects { subproject ->
|
||||
def matcher = line =~ /Copyright (20\d\d)-?(20\d\d)?/
|
||||
if (matcher.count) {
|
||||
def beginningYear = matcher[0][1]
|
||||
if (now != beginningYear || now != matcher[0][2]) {
|
||||
if (now != beginningYear && now != matcher[0][2]) {
|
||||
def years = "$beginningYear-$now"
|
||||
def sourceCode = file.text
|
||||
sourceCode = sourceCode.replaceFirst(/20\d\d(-20\d\d)?/, years)
|
||||
@@ -243,7 +243,7 @@ subprojects { subproject ->
|
||||
}
|
||||
}
|
||||
|
||||
processResources.dependsOn updateCopyrights
|
||||
compileKotlin.dependsOn updateCopyrights
|
||||
|
||||
jacocoTestReport {
|
||||
reports {
|
||||
|
||||
Reference in New Issue
Block a user