javagradleproject

What is the "no-split-project" option in Gradle "Build Init Plugin"?


The Build Init Plugin of Gradle 8.7 has documentation here.

In the example seen in Sample usage section:

gradle init \
  --type java-application \
  --dsl kotlin \
  --test-framework junit-jupiter \
  --package my.project \
  --project-name my-project  \
  --no-split-project  \
  --java-version 17

… we see the --no-split-project option. Unfortunately that option is not documented.

Does anyone know:


Solution

  • The opposite of no-split-project is split-project per the source code

    To see all the options, use the Help feature.

    gradle help --task init
    

    Result for Gradle 8.8-rc-1 is:

    Starting a Gradle Daemon (subsequent builds will be faster)
    
    > Task :help
    Detailed task information for init
    
    Path
         :init
    
    Type
         InitBuild (org.gradle.buildinit.tasks.InitBuild)
    
    Options
         --comments     Include clarifying comments in files.
    
         --no-comments     Disables option --comments.
    
         --dsl     Set the build script DSL to be used in generated scripts.
                   Available values are:
                        groovy
                        kotlin
    
         --incubating     Allow the generated build to use new features and APIs.
    
         --no-incubating     Disables option --incubating.
    
         --insecure-protocol     How to handle insecure URLs used for Maven Repositories.
                                 Available values are:
                                      ALLOW
                                      FAIL
                                      UPGRADE
                                      WARN
    
         --java-version     Provides java version to use in the project.
    
         --package     Set the package for source files.
    
         --project-name     Set the project name.
    
         --split-project     Split functionality across multiple subprojects?
    
         --no-split-project     Disables option --split-project.
    
         --test-framework     Set the test framework to be used.
                              Available values are:
                                   cpptest
                                   junit
                                   junit-jupiter
                                   kotlintest
                                   scalatest
                                   spock
                                   testng
                                   xctest
    
         --type     Set the type of project to generate.
                    Available values are:
                         basic
                         cpp-application
                         cpp-library
                         groovy-application
                         groovy-gradle-plugin
                         groovy-library
                         java-application
                         java-gradle-plugin
                         java-library
                         kotlin-application
                         kotlin-gradle-plugin
                         kotlin-library
                         pom
                         scala-application
                         scala-library
                         swift-application
                         swift-library
    
         --use-defaults     Use default values for options not configured explicitly
    
         --no-use-defaults     Disables option --use-defaults.
    
         --rerun     Causes the task to be re-run even if up-to-date.
    
    Description
         Initializes a new Gradle build.
    
    Group
         Build Setup
    
    BUILD SUCCESSFUL in 2s
    1 actionable task: 1 executed
    

    The Javadoc may provide a bit more information about each option. For example Javadoc for Gradle 8.7.

    I combined the Help and Javadoc info into this table.

    Option Opposite Help / Javadoc Values
    --comments --no-comments Include clarifying comments in files.
    --dsl Set the build script DSL to be used in generated scripts. groovy
    kotlin
    --incubating --no-incubating Allow the generated build to use new features and APIs.
    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.
    --insecure-protocol How to handle insecure URLs used for Maven Repositories. ALLOW
    FAIL
    UPGRADE
    WARN
    --java-version Provides java version to use in the project.
    Java version to be used by generated Java projects. When set, Gradle will use the provided value as the target major Java version for all relevant generated projects. Gradle will validate the number to ensure it is a valid and supported major version.
    --package Set the package for source files.
    --project-name Set the project name.
    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'.
    --split-project --no-split-project Split functionality across multiple subprojects?
    The desired DSL of build scripts to create, defaults to 'kotlin'.
    --test-framework Set the test framework to be used. cpptest
    junit
    junit-jupiter
    kotlintest
    scalatest
    spock
    testng
    xctest
    --type Set the type of project to generate.
    Defaults to 'basic' - a minimal scaffolding, following Gradle best practices. If a pom.xml is found in the project root directory, the type defaults to 'pom' and the existing project is converted to Gradle.
    basic
    cpp-application
    cpp-library
    groovy-application
    groovy-gradle-plugin
    groovy-library
    java-application
    java-gradle-plugin
    java-library
    kotlin-application
    kotlin-gradle-plugin
    kotlin-library
    pom
    scala-application
    scala-library
    swift-application
    swift-library
    --use-defaults --no-use-defaults Use default values for options not configured explicitly
    When true, the interactive dialog is skipped, and no user input is required to complete the command.
    --rerun Causes the task to be re-run even if up-to-date.