2017-10-05 126 views
1

我有兩個項目:另一個子項目作爲依賴編譯gradle這個子項目

workspace 
Project1 
    |--build.gradle 
    |--settings.gradle 
    |--Subproject1 
    | |--build.gradle 
    |--Subproject2 
    | |--build.gradle 

Project 2 
    |--build.gradle 
    |--settings.gradle 
    |--Subproject2-1 
    | |--build.gradle 

Subproject1有作爲依賴一個subproject2Subproject2-1需要subproject1,我該怎麼做才能subproject2-1有作爲一個依賴subproject1

回答

0

在你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') 
} 
相關問題