0
我正在改變我們的項目使用gradle作爲構建工具,但我正在努力解決2個問題;Gradle:多項目和構建WAR文件
背景:這是一個多項目gradle這個配置
:project-root
------:client //GWT Java Files & GWT Centric resources, e.g. CSS, Images, ui-xml etc..
------:server //Server based logic, e.g. controllers, services, repositories etc.
------:web-app//NON GWT resources for the web-app, e.g. , web.xml, static pages, images
1:爲了讓gwtCompile
任務在:client build.gradle
運行,我將其作爲對戰爭任務的依賴,就像這樣:
war{
dependsOn ':client:compileGwt'
from {'src/main/root-content'}
webInf {from 'src/main/web-inf-content'}
}
我不喜歡這個那麼有沒有在這樣做,以便當javaCompile
任務完成的:client
項目,所以GWT編譯器可以訪問由產生的gwtCompile
任務被稱爲一個簡單的方法tecode?通過簡單地把compile project(':client')
在:web應用程序依賴調用javaCompile
但不是gwtCompile
任務(因爲我本來期望)..
2:我在得到來自:client
項目輸出的GWT JavaScript和這些文件掙扎被複制到戰爭文件中。我需要這樣的東西在from
屬性如下:
war{
from {'src/main/root-content','$:CLIENT/gwt-compiler-js-output-dir-as-declared-in-client-build-file}
webInf {from 'src/main/web-inf-content'}
}
許多在此先感謝,
伊恩。
非常感謝 - 但是:yourproject.taskname需要在javaCompile任務之後運行.. – Ian
那麼它應該倒置嗎? 'taskName.dependsOn(project(':theOtherProject')。javaCompile)' – MrJohnBBQ