我有一个gradle项目,其格式如下:
DerivedProject
settings.gradle
build.gradle
DerivedFolderA
DerivedFolderB
DerivedFolderA和DerivedFolderB都只包含Java代码,没有gradle或settings.gradle文件。 DerivedProject build.gradle具有以下任务:
project(':DerivedFolderA')
project(':DerivedFolderB')
DerivedProject settings.gradle具有以下定义:
rootProject.name = 'DerivedProject'
include 'DerivedFolderA', 'DerivedFolderB'
我可以很好地建立这个项目。
我正在尝试将此代码添加到如下所示的根包中:
RootPackage
settings.gradle
build.gradle
SubdirectoryA
build.gradle
SubdirectoryB
build.gradle
SubdirectoryC
DerivedProject
settings.gradle
build.gradle
DerivedFolderA
DerivedFolderB
根项目中的settings.gradle具有以下内容:
include 'SubdirectoryA', \
include 'SubdirectoryB', \
include 'SubdirectoryC:DerivedProject'
但是,当我从RootPackage运行gradle build时,出现错误:
* Where:
Build file '/RootProject/SubdirectoryC/DerivedProject/build.gradle' line: 118
* What went wrong:
A problem occurred evaluating project ':SubdirectoryC:DerivedProject'.
> Project with path ':DerivedFolderA' could not be found in project ':SubdirectoryC:DerivedProject'.
我认为仅在根目录中采购DerivedProject就足够了。我的gradle定义中缺少什么吗?