项目名称只能在settings.gradle
. 例如:
include "foo" // or `includeFlat`, doesn't matter
// always good to nail down the root project name, because
// the root directory name may be different in some envs (e.g. CI)
// hence the following even makes sense for single-project builds
rootProject.name = "bar"
// change subproject name
project(":foo").name = "foofoo"
include
或者,您可以在语句中使用所需的项目名称,然后重新配置项目目录:
include "foofoo"
project(":foofoo").projectDir = file("foo")
include
为了提供一些背景知识,和之间的唯一区别includeFlat
是它们对项目的projectDir
. 否则它们是相同的。
Settings
有关更多信息,请查看Gradle 构建语言参考。