Gradle 8.7 的 Build Init Plugin 有文档here。
在示例用法部分中看到的示例:
gradle init \
--type java-application \
--dsl kotlin \
--test-framework junit-jupiter \
--package my.project \
--project-name my-project \
--no-split-project \
--java-version 17
...我们看到
--no-split-project
选项。不幸的是,该选项没有记录。
有谁知道吗:
no-split-project
选项到底有什么作用?与
no-split-project
相反的是split-project
,根据源代码
要查看所有选项,请使用帮助功能。
gradle help --task init
Gradle 8.8-rc-1 的结果是:
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
更易读的表格:
选项 | 对面 | 描述 | 价值观 |
---|---|---|---|
|
|
在文件中包含澄清注释。 | |
--DSL | 设置要在生成的脚本中使用的构建脚本 DSL。 | groovy kotlin |
|
|
|
允许生成的构建使用新功能和 API。 | |
|
如何处理 Maven 存储库使用的不安全 URL。 | 允许 失败 升级 警告 |
|
|
提供java版本在项目中使用。 | ||
|
设置源文件的包。 | ||
|
设置项目名称。 | ||
|
|
将功能拆分到多个子项目中? | |
|
设置要使用的测试框架。 | cpptest junit junit-jupiter kotlintest scalatest spock testng xctest |