带有CssResource的GWT 2.2项目使用ant

编译问题 在更大的GWT 2.2.0应用程序中,我们希望使用动态CellTable。与其他小部件不同,CellTable不使用css样式的标准名称(例如“gwt-MenuItem”)。所以我们必须从标准的css转移到CssResource,它必须包括标准的“gwt-”样式,如下所示:
public interface IPreferences
{
   public interface MyCssResource extends CssResource
   {
      String content();
      ...
   }

   @ImportedWithPrefix("gwt")
   public interface GwtCss extends CssResource
   {
      String MenuItem();
      String MenuBar();
      String TabLayoutPanelTab();
   }
   ... 

   public interface MyResources extends ClientBundle
   {
      public static final MyResources INSTANCE = GWT.create(MyResources.class);

      @Source("preferences.css")
      @Import(GwtCss.class) <--- any imported interface will produce error
      MyCssResource cssStd();
   }
}
这在托管模式下工作正常,可以使用eclipse编译,但不能使用ant编译:
   <target name="gwtc" depends="compile" description="GWT compile to JavaScript">
      <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
         <classpath>
            <pathelement location="src"/>
            <pathelement location="gwt-servlet.jar"/>
            <pathelement location="gwt-dev.jar"/>
            <pathelement location="gwt-user.jar"/>
         </classpath>
         <jvmarg value="-Xmx256M"/>
         <arg line="-war"/>
         <arg value="war"/>
         <arg value="...module.file"/>
      </java>
   </target>


   [java] [ERROR] Annotation error: cannot resolve ...IPreferences$GwtCss
   [java] java.lang.ClassNotFoundException: ...IPreferences$GwtCss
我找不到任何提示在eclipse之外编译这个必须做的事情。 谢谢你的评论。     
已邀请:
您需要在单独的任务中生成资源文件。生成它的调用(作为文档中的示例)是:
java -cp gwt-dev.jar:gwt-user.jar com.google.gwt.resources.css.InterfaceGenerator 
  -standalone -typeName some.package.MyCssResource -css input.css
所以它可以是一个java任务,就像编译器一样。它在gwt CssResource文档中有记录:http://code.google.com/p/google-web-toolkit/wiki/CssResource#Automatically_generating_interfaces     

要回复问题请先登录注册