Project Connection
Represents a long-lived connection to a Gradle project. You obtain an instance of a ProjectConnection
by using connect.
try (ProjectConnection connection = GradleConnector.newConnector()
.forProjectDirectory(new File("someFolder"))
.connect()) {
//obtain some information from the build
BuildEnvironment environment = connection.model(BuildEnvironment.class).get();
//run some tasks
connection.newBuild()
.forTasks("tasks")
.setStandardOutput(System.out)
.run();
}
Content copied to clipboard
Thread safety information
All implementations of ProjectConnection
are thread-safe, and may be shared by any number of threads.
All notifications from a given ProjectConnection
instance are delivered by a single thread at a time. Note, however, that the delivery thread may change over time.
Since
1.0-milestone-3
Functions
Link copied to clipboard
Creates a builder for an executer which can be used to run actions in different phases of the build.
Creates an executer which can be used to run the given action when the build has finished.
Link copied to clipboard
Link copied to clipboard
Kotlin extension function taking kotlin.reflect.KClass for org.gradle.tooling.ProjectConnection.getModel.
Link copied to clipboard
Kotlin extension function taking kotlin.reflect.KClass for org.gradle.tooling.ProjectConnection.model.
Link copied to clipboard
Creates a launcher which can be used to execute a build.
Link copied to clipboard
Creates a test launcher which can be used to execute tests.
Link copied to clipboard
Notifies all daemons about file changes made by an external process, like an IDE.