Skip to content

Commit d38db25

Browse files
committed
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`
1 parent fe5d0af commit d38db25

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ subprojects { subproject ->
228228
def matcher = line =~ /Copyright (20\d\d)-?(20\d\d)?/
229229
if (matcher.count) {
230230
def beginningYear = matcher[0][1]
231-
if (now != beginningYear || now != matcher[0][2]) {
231+
if (now != beginningYear && now != matcher[0][2]) {
232232
def years = "$beginningYear-$now"
233233
def sourceCode = file.text
234234
sourceCode = sourceCode.replaceFirst(/20\d\d(-20\d\d)?/, years)
@@ -243,7 +243,7 @@ subprojects { subproject ->
243243
}
244244
}
245245

246-
processResources.dependsOn updateCopyrights
246+
compileKotlin.dependsOn updateCopyrights
247247

248248
jacocoTestReport {
249249
reports {

0 commit comments

Comments
 (0)