Backport to Gradle 1.7