Package org.gradle.buildinit.tasks

## 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`, `Configurable<Task>`

      @DisableCachingByDefault(because="Not worth caching")
      public class InitBuild
      extends DefaultTask

  Generates a Gradle project structure.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.gradle.api.Task

      `Task.Namer`

  - ### Field Summary

    - ### Fields inherited from interface org.gradle.api.Task

      `TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `InitBuild()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `List<String>` | `getAvailableBuildTypes()` |
    `List<String>` | `getAvailableDSLs()` | Available build script DSLs to be used.
    `List<String>` | `getAvailableTestFrameworks()` | Available test frameworks.
    `String` | `getDsl()` | The desired DSL of build scripts to create, defaults to 'groovy'.
    `Property<InsecureProtocolOption>` | `getInsecureProtocol()` | How to handle insecure (http) URLs used for Maven Repositories.
    `String` | `getPackageName()` | The name of the package to use for generated source.
    `org.gradle.buildinit.plugins.internal.ProjectLayoutSetupRegistry` | `getProjectLayoutRegistry()` |
    `String` | `getProjectName()` | The name of the generated project, defaults to the name of the directory the project is generated in.
    `Property<Boolean>` | `getSplitProject()` | Should the build be split into multiple subprojects? This property can be set via command-line option '--split-project'.
    `String` | `getTestFramework()` | The test framework to be used in the generated project.
    `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'.
    `Property<Boolean>` | `getUseIncubating()` | Can the generated build use new and unstable features? When enabled, the generated build will use new patterns, APIs or features that may be unstable between minor releases.
    `void` | `setDsl​(String dsl)` | Set the build script DSL to be used.
    `void` | `setPackageName​(String packageName)` | Set the package name.
    `void` | `setProjectName​(String projectName)` | Set the project name.
    `void` | `setTestFramework​(String testFramework)` | Set the test framework to be used.
    `void` | `setType​(String type)` |
    `void` | `setupProjectLayout()` |

    - ### Methods inherited from class org.gradle.api.DefaultTask

      `compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService`

    - ### Methods inherited from class org.gradle.api.internal.AbstractTask

      `appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getOnlyIf, getReasonNotToTrackState, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, prependParallelSafeAction, setImpliesSubProjects`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.gradle.api.Task

      `doNotTrackState, getConvention`

- - ### Constructor Detail

    - #### InitBuild

          public InitBuild()

  - ### Method Detail

    - #### 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'.

    - #### getSplitProject

          @Input
          @Optional
          public Property<Boolean> getSplitProject()

      Should the build be split into multiple subprojects? This property can be set via command-line option '--split-project'.
      Since:
        6.7

    - #### getDsl

          @Optional
          @Input
          public String 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

    - #### getUseIncubating

          @Input
          @Optional
          @Incubating
          public Property<Boolean> getUseIncubating()

      Can the generated build use new and unstable features? When enabled, the generated build will use new patterns, APIs or features that may be unstable between minor releases. Use this if you'd like to try out the latest features of Gradle. By default, init will generate a build that uses stable features and behavior.
      Since:
        7.3

    - #### getProjectName

          @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

          @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'

    - #### getInsecureProtocol

          @Input
          @Incubating
          public Property<InsecureProtocolOption> getInsecureProtocol()

      How to handle insecure (http) URLs used for Maven Repositories. This property can be set via command-line option '--insecure-protocol'. The default value is 'warn'.
      Since:
        7.3

    - #### 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

          public void setDsl​(String dsl)

      Set the build script DSL to be used.
      Since:
        4.5

    - #### getAvailableDSLs

          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

          public void setProjectName​(String projectName)

      Set the project name.
      Since:
        5.0

    - #### setPackageName

          public void setPackageName​(String packageName)

      Set the package name.
      Since:
        5.0