2012-04-11 40 views
2

subprojectsallprojects屬性,但我怎麼才能從字面上列出已知的項目子集?我嘗試以下方法:Gradle。如何爲子項目列表指定共享配置?

[project(':child1'), project(':child2')] { 
    ... 
} 

這是由println allprojects輸出啓發:

[project ':stripper', project ':webui', project ':wikidigest'] 

,但它不工作。日誌輸出:

* What went wrong: 
A problem occurred evaluating root project 'projects'. 
> No signature of method: java.util.ArrayList.call() is applicable for argument types: (build_1ngb77rivv12hrhe33snq4jat0$_run_closure4) values: [[email protected]] 
    Possible solutions: tail(), wait(), last(), any(), max(), wait(long) 

回答

2

的解決方案是通過電話來包裝清單configure()

configure([project(':child1'), project(':child2')]) { 
    ... 
} 
相關問題