2017-02-03 82 views
0

我有以下多重結構:執行一個搖籃多項目的子模塊的任務

settings.gradle

rootProject.name = 'toolbox-backend' 
include 'toolbox-components-rest' 
include 'toolbox-components-executor' 
include 'toolbox-components-toolsyncer' 

我很想在我的根創建任務的build.gradle這將調用乾淨構建安裝(應用程序),最後運行toolbox-components-rest子模塊的任務。

回答

0
task startREST() { 

dependsOn ':toolbox-components-rest:clean' 
dependsOn ':toolbox-components-rest:build' 
dependsOn ':toolbox-components-rest:bootRun' 

println "[Toolbox $version] Starting REST interface..." 
} 

這是行不通的 - 但bootRun任務在生成之前運行,在clean之前運行。我想有它究竟是各地

其他方式固定在上面

bootRun.mustRunAfter build 
build.mustRunAfter clean 

工具箱組件休息子模塊的gradle.build