|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gradle.tooling.GradleConnector
public abstract class GradleConnector
A GradleConnector is the main entry point to the Gradle tooling API. You use this API as follows:
ProjectConnection connection = GradleConnector.newConnector() .forProjectDirectory(new File("someProjectFolder")) .connect(); try { connection.newBuild().forTasks("tasks").run(); } finally { connection.close(); }
GradleConnector instances are not thread-safe. If you want to use a GradleConnector concurrently you must always create a new instance for each thread using newConnector(). Note, however, the ProjectConnection instances that a connector creates are completely thread-safe.
Method Summary | |
---|---|
ProjectConnection
|
connect()
Creates a connection to the project in the specified project directory. |
GradleConnector
|
forProjectDirectory(File projectDir)
Specifies the working directory to use. |
static GradleConnector
|
newConnector()
Creates a new connector instance. |
GradleConnector
|
useDistribution(URI gradleDistribution)
Specifies which Gradle distribution to use. |
GradleConnector
|
useGradleUserHomeDir(File gradleUserHomeDir)
Specifies the user's Gradle home directory to use. |
GradleConnector
|
useGradleVersion(String gradleVersion)
Specifies which Gradle version to use. |
GradleConnector
|
useInstallation(File gradleHome)
Specifies which Gradle installation to use. |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Method Detail |
---|
public ProjectConnection connect()
public GradleConnector forProjectDirectory(File projectDir)
projectDir
- The working directory.
public static GradleConnector newConnector()
public GradleConnector useDistribution(URI gradleDistribution)
gradleDistribution
- The distribution to use.
public GradleConnector useGradleUserHomeDir(File gradleUserHomeDir)
gradleUserHomeDir
- The user's Gradle home directory to use.
public GradleConnector useGradleVersion(String gradleVersion)
gradleVersion
- The version to use.
public GradleConnector useInstallation(File gradleHome)
gradleHome
- The Gradle installation directory.
Gradle API 1.12