2012-03-12 116 views
0

我很想问一些关于我的问题与蚂蚁脚本。我有两个GWT项目,一个取决于另一个。我试图用Ant脚本来编译它们,但我由于未能:编译GWT项目与GWT项目依赖关系

[java]  [ERROR] Errors in 'file:/$PATH/$CLASS_NAME.java' 
[java]   [ERROR] Line 29: No source code is available for type $INHERITED_INTERFACE; did you forget to inherit a required module? 

而$ INERITED_INTERFACE是从库编译后的项目依赖于和$ CLASS_NAME是实现接口的类。

我试了一下简单的,但它不工作:

<target name="gwtcomp" depends="javacomp" description="GWT to JS"> 
    <echo message="Building GWT" /> 

    <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler"> 
     <classpath> 
      <pathelement location="${basedir}/src" /> 
      <path refid="project.class.path" /> 
     </classpath> 
     <jvmarg value="-Xmx512M" /> 
     <arg value="-strict" /> 

     <arg value="${project.dep.gwt.config}" /> 
     <arg value="${project.gwt.config}" /> 
    </java> 
</target> 

,但它不能去传递错误。我也继承了GWT库:

<module rename-to='project'> 
    ... 
    <inherits name='my.lib.common.Common'/> 
</module> 

不确定有什么问题。 Common.gwt.xml就在那里,它指向客户端并作为源包共享。任何人都可以帮忙吗?

回答

1

我想你必须将你的my.lib.common.Common库的源文件的位置添加到你的ant脚本的类路径中。 类似这样的:

<classpath> 
    <pathelement location="${basedir}/src" /> 
    <path refid="project.class.path" /> 
    <pathelement location="LOCATION_TO_MY.LIB.COMMON.COMMON"/> 
</classpath>