我有两个项目:
workspace
Project1
|--build.gradle
|--settings.gradle
|--Subproject1
| |--build.gradle
|--Subproject2
| |--build.gradle
Project 2
|--build.gradle
|--settings.gradle
|--Subproject2-1
| |--build.gradle
Subproject1
具有subproject2
和Subproject2-1
需要subproject1
的依赖关系,我如何才能subproject2-1
作为依赖关系subproject1
?
答案 0 :(得分:1)
在Project2/settings.gradle
使用中:
include ':Suproject2-1'
include ':MySub1'
project(':MySub1').projectDir = new new File('/Users/foo/workspace/xxx/Project1/Subproject1')
然后在Subproject2-1/build.gradle
使用:
dependencies {
compile project(':MySub1')
}