JENKINS-18629 - use Gradle in conditional-buildstep

This fix allows Gradle to be used in a conditional-buildstep and therefore fixes:
https://issues.jenkins-ci.org/browse/JENKINS-18629