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.
gradle.build
For Groovy based projects. It'd be:
tasks.withType(GroovyCompile) { options.debug = true }