How to get GWT to compile multiple modules?

爱⌒轻易说出口 提交于 2019-12-22 18:37:44

问题


I've set up a new GWT project in NetBeans 6.9 and created multiple GWT modules I've tried adding them all in the gwt.properties file as follows:

  *# The names of the modules to compile (separated by a space character)
  gwt.module=com.company.MyModule1 com.company.MyModule2 com.company.MyModule3*

I'm getting an error at compilation time saying that it doesn't find the second module. Now, i can compile just fine only ONE module. Doesn't matter which one. Is it something i'm doing wrong or it's a bug in gwt/nbgwt ?

I also tried this:

 *# The names of the modules to compile (separated by a space character)
  gwt.module=com.company.MyModule1
  gwt.module=com.company.MyModule2
  gwt.module=com.company.MyModule3*

In this case only the last module in the list gets compiled.


回答1:


You need to create a gwt.xml file per module.

Then you can compile all of them with an ANT Task

<target name="gwtc" depends="javac" description="GWT compile to JavaScript">
    <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
        <classpath>
            <pathelement location="src"/>
            <path refid="project.class.path"/>
        </classpath>
        <!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
        <arg value="${myModuleName}"/>
    </java>
</target>


来源:https://stackoverflow.com/questions/4321365/how-to-get-gwt-to-compile-multiple-modules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!