GRADLE-3167
Merge pull request #328 from shutyaev/master

thanks again for the contribution. I've just merged this into master. This will be part of Gradle 2.2. As promissed this is the fasted way to get small fixes into the gradle codebase ;-)