public interface BuildEnvironment extends Model, BuildModel
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();
}
| Modifier and Type | Method and Description |
|---|---|
BuildIdentifier |
getBuildIdentifier()
Returns the identifier for the Gradle build that this environment is used by.
|
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.
|
@Incubating BuildIdentifier getBuildIdentifier()
getBuildIdentifier in interface BuildModelGradleEnvironment getGradle()
JavaEnvironment getJava() throws UnsupportedMethodException
UnsupportedMethodException - For Gradle versions older than 1.0-milestone-8, where this method is not supported.