Apply temporary workaround for GRADLE-3082, and upgrade Gradle to 1.12.