Can one configure Gradle to change java compiler output locale or encoding?
The problem: gradle in run on Windows with non English default Local (in particular it is Chinese)
There is possibility to do that configuring Java, e.g. Setting java locale settings .
Can Gradle do (that is just for this build, CI job) ?
UPDATE:
As Vadim referenced, for source encoding, this snippet is used.
tasks.withType(Compile) {
options.encoding = 'UTF-8'
}
Details: Gradle calls Java compile, that defaults to system Locale (in my case it is Chinese). So when error appears, it is shown in Chinese. Java documentation says to configure via environment variable. But I want to do it only for this build.gradle
... Possibly I need to change that environment variable before and after compilation automatically, it Gradle does not provide such costomization.