Builds a new composite Gradle connection.
GradleConnectionBuilder builder = GradleConnector.newGradleConnection(); // Add a participant with root directory 'someFolder' using the Gradle version defined in the build builder.addParticipant(new File("someFolder")); // Add a participant with root directory 'someOtherFolder' using Gradle Version 2.6 builder.addParticipant(new File("someOtherFolder")).useGradleVersion("2.6"); // Set the Gradle user home for the entire connection builder.useGradleUserHomeDir(new File("/path/to/.gradle")); GradleConnection connection = builder.build(); try { // Use connection } finally { connection.close(); }
Modifiers | Name | Description |
---|---|---|
interface |
GradleConnectionBuilder.ParticipantBuilder |
Builds a new participant that will be included in the connection. |
Type | Name and description |
---|---|
GradleConnectionBuilder.ParticipantBuilder |
addParticipant(File projectDirectory) Adds a new participant build to this connection, returning a build for further configuration. |
GradleConnection |
build() Builds the connection. |
GradleConnectionBuilder |
useGradleUserHomeDir(File gradleUserHomeDir) Specifies the user's Gradle home directory to use. |
Adds a new participant build to this connection, returning a build for further configuration.
projectDirectory
- The root project directory for the participant.Builds the connection. You should call GradleConnection.close when you are finished with the connection.
Specifies the user's Gradle home directory to use. Defaults to ~/.gradle
.
gradleUserHomeDir
- The user's Gradle home directory to use.