Package org.gradle.testfixtures
Klasse ProjectBuilder
java.lang.Object
org.gradle.testfixtures.ProjectBuilder
Creates dummy instances of Project which you can use in testing custom task and plugin
implementations.
To create a project instance:
- Create a
ProjectBuilderinstance by callingbuilder(). - Optionally, configure the builder.
- Call
build()to create theProjectinstance.
You can reuse a builder to create multiple Project instances.
The ProjectBuilder implementation bundled with Gradle 3.0 and 3.1 suffers from a
binary compatibility issue exposed by applying plugins compiled with Gradle 2.7 and earlier.
Applying those pre-compiled plugins in a ProjectBuilder context will result in a ClassNotFoundException.
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbuild()Creates the project.static ProjectBuilderbuilder()Creates a project builder.Specifies the Gradle user home for the builder.Specifies the name for the projectwithParent(Project parent) Specifies the parent project.withProjectDir(File dir) Specifies the project directory for the project to build.
-
Methodendetails
-
builder
Creates a project builder.- Gibt zurück:
- The builder
-
withProjectDir
Specifies the project directory for the project to build.- Parameter:
dir- The project directory- Gibt zurück:
- The builder
-
withGradleUserHomeDir
Specifies the Gradle user home for the builder. If not set, an empty directory under the project directory will be used.- Gibt zurück:
- The builder
-
withName
Specifies the name for the project- Parameter:
name- project name- Gibt zurück:
- The builder
-
withParent
Specifies the parent project. Use it to create multi-module projects.- Parameter:
parent- parent project- Gibt zurück:
- The builder
-
build
Creates the project.- Gibt zurück:
- The project
-