# connect

abstract fun connect(): ProjectConnection

Creates a connection to the project in the specified project directory. You should call close when you are finished with the connection.

Note, that the returned instance does not automatically pick up changes if the connection configuration (e.g. the gradle.properties file) changes. It's the client's responsibility to close the connection and create a new one in that scenario.

#### Return

The connection. Never return null.

#### Since

1.0-milestone-3

#### Throws

UnsupportedVersionException

When the target Gradle version does not support this version of the tooling API.

GradleConnectionException

On failure to establish a connection with the target Gradle version.