use of org.gradle.tooling.model.build.BuildEnvironment in project intellij-community by JetBrains.
the class GradleExecutionHelper method getBuildEnvironment.
@Nullable
public static BuildEnvironment getBuildEnvironment(@NotNull ProjectConnection connection) {
try {
final BuildEnvironment buildEnvironment = connection.getModel(BuildEnvironment.class);
if (LOG.isDebugEnabled()) {
try {
LOG.debug("Gradle version: " + buildEnvironment.getGradle().getGradleVersion());
LOG.debug("Gradle java home: " + buildEnvironment.getJava().getJavaHome());
LOG.debug("Gradle jvm arguments: " + buildEnvironment.getJava().getJvmArguments());
} catch (Throwable t) {
LOG.debug(t);
}
}
return buildEnvironment;
} catch (Exception e) {
LOG.warn("can not get BuildEnvironment model", e);
return null;
}
}
Aggregations