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 TypeMethodDescriptionvoid
customize
(String name, Consumer<GradleTask.Builder> task) Customize a task with the specified name.void
customizeWithType
(String type, Consumer<GradleTask.Builder> task) Customize a task matching a given type.Get aGradleTask
with the specified task name.boolean
Specify if this container has a task customization with the specifiedname
.Return the fully qualified name of types to import.boolean
isEmpty()
Specify if this container is empty.boolean
Remove the task with the specifiedname
.values()
Return theGradle tasks
to customize.
-
Constructor Details
-
GradleTaskContainer
public GradleTaskContainer()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Specify if this container is empty.- Returns:
true
if no task is registered
-
has
Specify if this container has a task customization with the specifiedname
.- Parameters:
name
- the name of a task- Returns:
true
if a customization for a task with the specifiedname
exists
-
values
Return theGradle tasks
to customize.- Returns:
- the gradle tasks
-
get
Get aGradleTask
with 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:
true
if such a task was registered,false
otherwise
-