Class GradleTaskContainer
java.lang.Object
io.spring.initializr.generator.buildsystem.gradle.GradleTaskContainer
A container for Gradle tasks.
- Author:
- Stephane Nicoll
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcustomize(String name, Consumer<GradleTask.Builder> task) Customize a task with the specified name.voidcustomizeWithType(String type, Consumer<GradleTask.Builder> task) Customize a task matching a given type.Get aGradleTaskwith the specified task name.booleanSpecify if this container has a task customization with the specifiedname.Return the fully qualified name of types to import.booleanisEmpty()Specify if this container is empty.booleanRemove the task with the specifiedname.values()Return theGradle tasksto customize.
-
Constructor Details
-
GradleTaskContainer
public GradleTaskContainer()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Specify if this container is empty.- Returns:
trueif no task is registered
-
has
Specify if this container has a task customization with the specifiedname.- Parameters:
name- the name of a task- Returns:
trueif a customization for a task with the specifiednameexists
-
values
Return theGradle tasksto customize.- Returns:
- the gradle tasks
-
get
Get aGradleTaskwith the specified task name.- Parameters:
task- the name or type- Returns:
- the matching gradle task or
null
-
importedTypes
Return the fully qualified name of types to import.- Returns:
- the imported types
-
customize
Customize a task with the specified name. If the task has already been customized, the consumer can be used to further tune the existing task.- Parameters:
name- the name of a tasktask- a callback to customize the task
-
customizeWithType
Customize a task matching a given type. If the task has already been customized, the consumer can be used to further tune the existing task.- Parameters:
type- the name of type. Can use the short form for well-known types such asJavaCompile, use a fully qualified name if an import is requiredtask- a callback to customize the task
-
remove
Remove the task with the specifiedname.- Parameters:
name- the name of the task- Returns:
trueif such a task was registered,falseotherwise
-