Class GradleTask.Builder

java.lang.Object
io.spring.initializr.generator.buildsystem.gradle.GradleTask.Builder
Enclosing class:
GradleTask

public static class GradleTask.Builder extends Object
A builder for GradleTask.
  • Constructor Details

    • Builder

      protected Builder(String name, String type)
    • Builder

      protected Builder(String name)
  • Method Details

    • attribute

      public void attribute(String target, String value)
      Set a task attribute.
      Parameters:
      target - the name of the attribute
      value - the value
    • append

      public void append(String target, String value)
      Configure a task attribute by appending the specified value.
      Parameters:
      target - the name of the attribute
      value - the value to append
    • invoke

      public void invoke(String target, String... arguments)
      Invoke a task method.
      Parameters:
      target - the name of the method
      arguments - the arguments
    • nested

      public void nested(String property, Consumer<GradleTask.Builder> customizer)
      Customize a nested task for the specified property. If such nested task has already been added, the consumer can be used to further tune the existing task configuration.
      Parameters:
      property - a task property
      customizer - a Consumer to customize the nested task
    • build

      public GradleTask build()
      Build a GradleTask with the current state of this builder.
      Returns:
      a GradleTask