Fix Gradle build to read files in UTF-8

https://build.spring.io/browse/INT-SI51X-18

When we have non-standard symbols in the source code, the `updateCopyrights`
Gradle task may break them after because of non-compatible encoding
between file reader and source code.

* Add `org.gradle.jvmargs='-Dfile.encoding=UTF-8'` to the `gradle.properties`
to enforce an expected file reading encoding.
* Fix `AbstractFilePayloadTransformerTests` to bring non-standard
symbols back
This commit is contained in:
Artem Bilan
2019-03-22 13:39:43 -04:00
parent afa8753239
commit b19535b570
3 changed files with 3 additions and 2 deletions

View File

@@ -232,7 +232,7 @@ subprojects { subproject ->
def years = "$beginningYear-$now"
def sourceCode = file.text
sourceCode = sourceCode.replaceFirst(/20\d\d(-20\d\d)?/, years)
file.write(sourceCode)
file.text = sourceCode
println "Copyright updated for file: $file"
}
break

View File

@@ -1 +1,2 @@
version=5.1.4.BUILD-SNAPSHOT
org.gradle.jvmargs='-Dfile.encoding=UTF-8'

View File

@@ -42,7 +42,7 @@ public abstract class AbstractFilePayloadTransformerTests<T extends AbstractFile
static final String DEFAULT_ENCODING = "UTF-8";
static final String SAMPLE_CONTENT = "HelloWorld\n????";
static final String SAMPLE_CONTENT = "HelloWorld\näöüß";
T transformer;