我正在尝试为我的项目布局已经由我决定的情况制作一个 Gradle 多项目构建。我有这样的事情:
-->Shared\
---->SharedComponent1\
------>build.gradle
------>src\
...
---->SharedComponent2\
------>build.gradle
...
-->Product1\
---->ProductComponent1\
------>build.gradle
---->ProductComponent2\
------>build.gradle
...
---->build\
------>settings.gradle
我的 settings.gradle 看起来像这样:
rootProject.name = 'Product1'
rootProject.projectDir = new File( "${ProjectsRoot}" )
include 'Shared:SharedComponent1'
include 'Shared:SharedComponent2'
include 'Product1:ProductComponent1'
include 'Product1:ProductComponent2'
当我像这样在构建文件夹中运行 Gradle 时:
gradle -PProjectsRoot=c:\my\project\root\dir projects
我得到:
:projects
------------------------------------------------------------
Root project
------------------------------------------------------------
Root project 'build'
No sub-projects
To see a list of the tasks of a project, run gradle <project-path>:tasks
For example, try running gradle :tasks
BUILD SUCCESSFUL
即它没有找到我正在尝试构建的项目。通过 Gradle 的多项目支持,我正在尝试做的事情是否可行?还是我在叫错树?