# connect

abstract fun connect(): ProjectConnection(source)

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

#### Throws

org.gradle.tooling.UnsupportedVersionException

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

org.gradle.tooling.GradleConnectionException

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