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