title: Create GWT-compile rule for Ant build.xml
body: <p>I'm trying to make an Eclipse-compilable GWT project also compilable on the command line (via Ant).</p>
  
  <p>Eclipse provides functionality to export a <code>build.xml</code>; this works fine for compiling the classes, but since GWT's special stuff is all provided via a plugin, these rules are not included.</p>
  
  <p>Google provides <a href="http://code.google.com/webtoolkit/doc/1.6/RefCommandLineTools.html#webAppCreator" rel="nofollow">a tool</a> for creating <code>build.xml</code> files for new projects.  I've incorporated the rules generated by this into the Eclipse-exported file.</p>
  
  <p>Compiling (the part provided by Eclipse) is successful.</p>
  
  <p>Here is the compile-things-to-javascript task:</p>
  
  <pre><code>  &lt;target name="gwtc" depends="build" description="GWT compile to JavaScript (production mode)"&gt;
      &lt;java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler"&gt;
        &lt;classpath&gt;
          &lt;pathelement location="war/WEB-INF/classes"/&gt;
          &lt;pathelement location="src"/&gt;
          &lt;path refid="project.class.path"/&gt;
          &lt;pathelement location="/Applications/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201201120043-rel-r37/gwt-2.4.0/validation-api-1.0.0.GA.jar" /&gt;
          &lt;pathelement location="/Applications/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201201120043-rel-r37/gwt-2.4.0/validation-api-1.0.0.GA-sources.jar" /&gt;
        &lt;/classpath&gt;
        &lt;!-- add jvmarg -Xss16M or similar if you see a StackOverflowError --&gt;
        &lt;jvmarg value="-Xmx256M"/&gt;
        &lt;!--&lt;arg line="-style PRETTY"/&gt;--&gt;
        &lt;arg line="-war"/&gt;
        &lt;arg value="war"/&gt;
        &lt;!-- Additional arguments like -style PRETTY or -logLevel DEBUG --&gt;
        &lt;arg line="${gwt.args}"/&gt;
        &lt;arg value="edu.calpoly.csc.scheduler"/&gt;
      &lt;/java&gt;
    &lt;/target&gt;
  </code></pre>
  
  <p>The <code>.gwt.xml</code> file looks like so:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;                                                 
  &lt;module rename-to='gwtview'&gt;                                                           
    &lt;!-- Inherit the core Web Toolkit stuff.                        --&gt;                  
    &lt;inherits name='com.google.gwt.user.User'/&gt;                                          
  
    &lt;!-- Inherit the default GWT style sheet.  You can change       --&gt;
    &lt;!-- the theme of your GWT application by uncommenting          --&gt;                  
    &lt;!-- any one of the following lines.                            --&gt;                  
    &lt;inherits name='com.google.gwt.user.theme.clean.Clean'/&gt;                             
    &lt;!-- &lt;inherits name='com.google.gwt.user.theme.standard.Standard'/&gt; --&gt;              
    &lt;!-- &lt;inherits name='com.google.gwt.user.theme.chrome.Chrome'/&gt; --&gt;                  
    &lt;!-- &lt;inherits name='com.google.gwt.user.theme.dark.Dark'/&gt;     --&gt;                  
  
    &lt;!-- Other module inherits                                      --&gt;                  
  
    &lt;!-- Specify the app entry point class.                         --&gt;                  
    &lt;entry-point class='edu.calpoly.csc.scheduler.view.client.GWTView'/&gt;                                                                                                        
    &lt;!-- Specify the paths for translatable code                    --&gt;                  
    &lt;source path='client'/&gt;                                                              
    &lt;source path='shared'/&gt;
    &lt;source path='view'/&gt;                                                                
  
  &lt;/module&gt; 
  </code></pre>
  
  <p>When trying to run the task, I get this error:</p>
  
  <pre><code>gwtc:
       [java] Compiling module edu.calpoly.csc.scheduler
       [java]    Finding entry point classes
       [java]       [ERROR] Unable to find type 'edu.calpoly.csc.scheduler.view.client.GWTView'
       [java]          [ERROR] Hint: Previous compiler errors may have made this type unavailable
       [java]          [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
  </code></pre>
  
  <p>Which seems strange to me, since the class is very much there:</p>
  
  <pre><code>[$]&gt; ls war/WEB-INF/classes/edu/calpoly/csc/scheduler/view/client 
  GWTView$1.class            GWTView$1MyHandler.class   GreetingService.class
  GWTView$1MyHandler$1.class GWTView.class              GreetingServiceAsync.class
  </code></pre>
  
  <p>Halp?</p>