connector.forProjectDirectory(executer.getSpec().getProjectDir());
File gradleUserHomeDir = gradle.getStartParameter().getGradleUserHomeDir();
if (gradleUserHomeDir != null) {
connector.useGradleUserHomeDir(gradleUserHomeDir);
}
<BUG>GradleVersion gradleVersion = executer.getSpec().getGradleVersion();
if (gradleVersion.equals(GradleVersion.current())) {</BUG>
connector.useInstallation(gradle.getGradleHomeDir());
} else {
connector.useGradleVersion(gradleVersion.getVersion());

connector.forProjectDirectory(executer.getSpec().getProjectDir());
File gradleUserHomeDir = gradle.getStartParameter().getGradleUserHomeDir();
if (gradleUserHomeDir != null) {
connector.useGradleUserHomeDir(gradleUserHomeDir);
}
GradleVersion gradleVersion = executer.getGradleVersion();
if (gradleVersion.equals(GradleVersion.current())) {
connector.useInstallation(gradle.getGradleHomeDir());
} else {
connector.useGradleVersion(gradleVersion.getVersion());
