2012-03-12 114 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>