To avoid warnings regarding special characters when building my Java source code, I put this line in my gradle.build
which worked fine before upgrading to Gradle 2.
For Groovy based projects. It'd be:
tasks.withType(GroovyCompile) {
options.debug = true
}
Changing the line to
tasks.withType(JavaCompile) { options.encoding = "UTF-8" }
fixed the issue.
Use task.withType(JavaCompile)
.
My code:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.bmuschko:gradle-tomcat-plugin:2.2.3'
}
tasks.withType(JavaCompile) {
options.debug = true
options.debugOptions.debugLevel = "source,lines,vars"
options.encoding = "UTF-8"
}
}