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:06 -05:00
parent 5d55753dae
commit 6a1795802e

View File

@@ -307,7 +307,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"