Work around http://issues.gradle.org/browse/GRADLE-1826