例如有模块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')
}
重新编译工程即可。