Groovy Documentation

org.gradle.tooling.model.build
[Java] Interface BuildEnvironment

org.gradle.tooling.model.Model
  org.gradle.tooling.model.build.BuildEnvironment
All Superinterfaces:
Model

public interface BuildEnvironment
extends Model

Informs about the build environment, like Gradle version or the Java home in use.

Example:

 ProjectConnection connection = GradleConnector.newConnector()
    .forProjectDirectory(new File("someProjectFolder"))
    .connect();

 try {
    BuildEnvironment env = connection.getModel(BuildEnvironment.class);
    System.out.println("Gradle version: " + env.getGradle().getGradleVersion());
    System.out.println("Java home: " + env.getJava().getJavaHome());
 } finally {
    connection.close();
 }
 
Since:
1.0-milestone-8


Method Summary
GradleEnvironment getGradle()

Returns information about the Gradle environment, for example the Gradle version.

JavaEnvironment getJava()

Returns information about the Java environment, for example the Java home or the JVM args used.

 

Method Detail

getGradle

public GradleEnvironment getGradle()
Returns information about the Gradle environment, for example the Gradle version.
Since:
1.0-milestone-8


getJava

public JavaEnvironment getJava()
Returns information about the Java environment, for example the Java home or the JVM args used.
throws:
org.gradle.tooling.model.UnsupportedMethodException when the Gradle version the tooling API is connected to does not support the Java environment information.
Since:
1.0-milestone-8


 

Gradle API 1.12