Fix updateCopyright Gradle task to read files in UTF-8

This would avoid non-ASCII symbols breakage on those operating systems where UTF-8 is not default
This commit is contained in:
Artem Bilan
2024-01-11 13:32:53 -05:00
parent e2f721b69f
commit 73111d97ba

View File

@@ -181,7 +181,7 @@ configure(javaProjects) { subproject ->
def beginningYear = matcher[0][1]
if (now != beginningYear && now != matcher[0][2]) {
def years = "$beginningYear-$now"
def sourceCode = file.text
def sourceCode = file.getText('UTF-8')
sourceCode = sourceCode.replaceFirst(/20\d\d(-20\d\d)?/, years)
file.text = sourceCode
println "Copyright updated for file: $file"