我正在更改我们的项目以使用 gradle 作为构建工具,但我正在努力解决两个问题;
上下文:它是一个多项目的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 任务的依赖,如下所示:
war{
dependsOn ':client:compileGwt'
from {'src/main/root-content'}
webInf {from 'src/main/web-inf-content'}
}
我不喜欢这样,是否有更简单的方法来执行此操作,以便在项目中的任务完成gwtCompile
时调用任务,以便 GWT 编译器可以访问生成的字节码?通过简单地放入:web-app 依赖项调用而不是任务(正如我所期望的那样)..javaCompile
:client
compile project(':client')
javaCompile
gwtCompile
2:我努力从项目中获取 GWT JavaScript 输出:client
并将这些文件复制到 war 文件中。我在属性中需要以下内容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'}
}
提前谢谢了,
伊恩。