Class InitBuild

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.gradle.buildinit.tasks.InitBuild
All Implemented Interfaces:
Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Task, org.gradle.util.Configurable<Task>

public class InitBuild extends DefaultTask
Generates a Gradle project structure.
  • Constructor Details

    • InitBuild

      public InitBuild()
  • Method Details

    • getType

      @Input public String getType()
      The desired type of project to generate, defaults to 'pom' if a 'pom.xml' is found in the project root and if no 'pom.xml' is found, it defaults to 'basic'. This property can be set via command-line option '--type'.
    • getDsl

      The desired DSL of build scripts to create, defaults to 'groovy'. This property can be set via command-line option '--dsl'.
      Since:
      4.5
    • getProjectName

      @Incubating @Input public String getProjectName()
      The name of the generated project, defaults to the name of the directory the project is generated in. This property can be set via command-line option '--project-name'.
      Since:
      5.0
    • getPackageName

      @Incubating @Input public String getPackageName()
      The name of the package to use for generated source. This property can be set via command-line option '--package'.
      Since:
      5.0
    • getTestFramework

      @Nullable @Optional @Input public String getTestFramework()
      The test framework to be used in the generated project. This property can be set via command-line option '--test-framework'
    • getProjectLayoutRegistry

      public org.gradle.buildinit.plugins.internal.ProjectLayoutSetupRegistry getProjectLayoutRegistry()
    • setupProjectLayout

      public void setupProjectLayout()
    • setType

      public void setType(String type)
    • getAvailableBuildTypes

      public List<String> getAvailableBuildTypes()
    • setDsl

      @Incubating public void setDsl(String dsl)
      Set the build script DSL to be used.
      Since:
      4.5
    • getAvailableDSLs

      @Incubating public List<String> getAvailableDSLs()
      Available build script DSLs to be used.
      Since:
      4.5
    • setTestFramework

      public void setTestFramework(@Nullable String testFramework)
      Set the test framework to be used.
    • getAvailableTestFrameworks

      public List<String> getAvailableTestFrameworks()
      Available test frameworks.
    • setProjectName

      @Incubating public void setProjectName(String projectName)
      Set the project name.
      Since:
      5.0
    • setPackageName

      @Incubating public void setPackageName(String packageName)
      Set the package name.
      Since:
      5.0