Integer timeoutSec = GlobalGradleSettings.getGradleDaemonTimeoutSec().getValue();
if (timeoutSec != null && result instanceof DefaultGradleConnector) {
((DefaultGradleConnector)result).daemonMaxIdleTime(timeoutSec, TimeUnit.SECONDS);
}
NbGradleProject gradleProject = project.getLookup().lookup(NbGradleProject.class);
if (gradleProject == null) {
throw new IllegalArgumentException("Not a Gradle project: " + project.getProjectDirectory());
}
File gradleUserHome = GlobalGradleSettings.getGradleUserHomeDir().getValue();
if (gradleUserHome != null) {
result.useGradleUserHomeDir(gradleUserHome);
}
GradleLocation gradleLocation;
ProjectProperties projectProperties = gradleProject.getLoadedProperties(cancelToken);
if (projectProperties == null) {
LOGGER.warning("Could not wait for retrieving the project properties. Using the globally defined one");
gradleLocation = GlobalGradleSettings.getGradleHome().getValue();
}
else {