例如有模块eat、transportation、console、work四个模块,其中work模块依赖eat、transportation 这两个模块。配置如下:
1.在work 模块中的settings.gradle 文件中配置:
include 'eat'
project (':eat').projectDir=new File(settingsDir,'../eat')
include 'transportation'
project (':transportation').projectDir=new File(settingsDir,'../transportation')
2.在work模块中的build.gradle文件中配置
dependencies {
//others
implementation project(':eat')
implementation project(':transportation')
}
重新编译工程即可。
文章讲述了如何在work模块中配置对eat和transportation模块的依赖。在settings.gradle文件中,通过include语句指定这两个模块的位置,然后在build.gradle文件的dependencies块中声明对它们的实现。完成配置后,重新编译工程以确保依赖关系正确。
1万+

被折叠的 条评论
为什么被折叠?



