具有依赖项目源的SuperDevMode

时间:2015-02-02 21:50:03

标签: java javascript eclipse gwt gwt-super-dev-mode

我有一个名为ProjectA的GWT项目,它是一个使用GWT eclipse插件生成的简单Web应用程序项目。

另外,我有第二个项目(projectB),它是一个具有以下结构的纯Java项目

src/com/test/shared/TestClass.java
src/com/test/Shared.gwt.xml

Shared.gwt.xml就像这样:

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='shared'>
    <inherits name='com.google.gwt.user.User'/>
    <source path='shared'/>
</module>

TestClass.java是:

public class TestClass {

  public static void start() {
    // do something    
  }

}

在projectA的gwt.xml中,我包含了<inherits name="com.test.Shared" />。我在projectA的某些方法中使用TestClass.start()。 然后我将projectB包含在projectA中。因此我右键单击了projectA&gt; Properties&gt; Java构建路径&gt;项目和添加的项目B.我切换到Order and Export标签并激活了projectB上的复选标记。

到目前为止一切顺利。当我在projectA上执行GWT编译时,我没有错误,但是当我在SuperDevMode中运行projectA时,编译器会输出以下错误:

GET /recompile/mobilePhoneGapIOS
   Job test.mobile.MobilePhoneGapIOS_1_4
      starting job: test.mobile.MobilePhoneGapIOS_1_4
      binding: mgwt.density=xhigh
      Compiling module test.mobile.MobilePhoneGapIOS
         Ignored 1 unit with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
         Computing all possible rebind results for 'com.gwtplatform.mvp.client.ApplicationController'
            Rebinding com.gwtplatform.mvp.client.ApplicationController
               Invoking generator com.gwtplatform.mvp.rebind.ApplicationControllerGenerator
                  [ERROR] The type 'test.mobile.client.BootstrapperImpl' was not found.
         [ERROR] Errors in 'gen/com/google/gwt/lang/test_00046mobile_00046MobilePhoneGapIOS__EntryMethodHolder.java'
            [ERROR] Line 3: Failed to resolve 'com.gwtplatform.mvp.client.ApplicationController' via deferred binding
         [WARN] For the following type(s), generated source was never committed (did you forget to call commit()?)
            [WARN] com.gwtplatform.mvp.client.ApplicationControllerImpl
         Unification traversed 597 fields and methods and 351 types. 2 are considered part of the current module and 22 had all of their fields and methods traversed.
         [WARN] Some stale types ([test.mobile.client.BootstrapperImpl$7, test.mobile.client.BootstrapperImpl$6, test.mobile.client.BootstrapperImpl$5, test.mobile.client.BootstrapperImpl$4, test.mobile.client.BootstrapperImpl$3, test.mobile.client.BootstrapperImpl$2$3, test.mobile.client.BootstrapperImpl, test.mobile.client.BootstrapperImpl$2$2, test.mobile.client.BootstrapperImpl$2, test.mobile.client.BootstrapperImpl$1, com.gwtplatform.dispatch.rest.client.serialization.com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment, test.mobile.client.BootstrapperImpl$9, test.mobile.client.BootstrapperImpl$8, com.gwtplatform.mvp.client.com_gwtplatform_mvp_client_DesktopGinjectorImpl, com.gwtplatform.mvp.client.DesktopGinjectorProvider, test.mobile.client.BootstrapperImpl$2$1, test.mobile.client.com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment, com.gwtplatform.mvp.client.ClientGinjector, test.mobile.client.BootstrapperImpl$10]) were not reprocessed as was expected. This is either a compiler bug or a Generator has legitimately stopped creating these types.
      [ERROR] Compiler returned false
      [WARN] recompile failed
      [WARN] continuing to serve previous version 

错误不会显示TestClass类,但是当我将其注释掉(不使用TestClass.start())时,它会在SDM中编译没有问题。

我知道我可以预编译projectB并在projectA中将源包含为jar lib,但我希望能够一直修改projectB的代码。

如何在使用链接的projectB时让SuperDevMode正常工作?

1 个答案:

答案 0 :(得分:-1)

生成器可能需要在路径中编译.class文件。因此,尝试将bin /(或Eclipse调用的任何内容)文件夹包含在类路径