I have a task:
task info<<{
println "Gradle — система автоматической сборки, построенная на принципах Apache Ant и Apache Maven, но предоставляющая DSL на языке Groovy вместо традиционной XML-образной формы представления конфигурации проекта."
}
when I use the command:
gradle info -Dfile.encoding=UTF-8
The text is not shown properly. How to fix it? Thanks.
The file.encoding
system property needs to be set right when the JVM executing the Gradle build (e.g. the Gradle Daemon) starts up. One way to achieve this is with export GRADLE_OPTS="-Dfile.encoding=utf-8"
. Another way that might work is to add systemProp.file.encoding=utf-8
to gradle.properties
. Of course this assumes that the build script files are actually using utf-8 encoding. To see what your platform's (and therefore Gradle's) default encoding is, print out the system property's value in a build script.