api / org.gradle.testkit.runner / GradleRunner / create

create

open static fun create(): GradleRunner

Creates a new Gradle runner.

The runner requires a Gradle distribution (and therefore a specific version of Gradle) in order to execute builds. This method will find a Gradle distribution, based on the filesystem location of this class. That is, it is expected that this class is loaded from a Gradle distribution.

When using the runner as part of tests being executed by Gradle (i.e. a build using the gradleTestKit() dependency), this means that the same distribution of Gradle that is executing the tests will be used by runner returned by this method.

When using the runner as part of tests being executed by an IDE, this means that the same distribution of Gradle that was used when importing the project will be used.

Return
a new Gradle runner