2

Hi I'm working my way through creating a groovy script to automate building and packaging a gwt application.

AntBuilder is bundled as part of Groovy and I really like the concept. It really does help the readability of the resulting script.

However I'm having some problems getting my script to invoke the GWT compiler. The code is as follows:

ant.sequential{

    path( id:"gwt.path" , location:"src", { fileset (dir:"${GWT_HOME}", includes:"gwt-dev.jar" )   }      )

    ant.java ( fork:true,  maxmemory:"256M", classpathref:"gwt.path", classname:"com.google.gwt.dev.Compiler"
        ,  {    classpath { pathelement location:"src" }
                classpath { pathelement location:"${GWT_HOME}/gwt-user.jar" }
                classpath { pathelement location:"${WEB_INF}/classes" }
                arg (value:"-war")
                arg (value:"bin/www")
                arg (value:"com/xxx/xxx/xx/xxx/xxx/GWT_DuplicateFinder")
                }
        )
}

As far as I can tell I've converted the equivalent ant scripting correctly (pasted from a previous build.xml file used on another gwt project.

<target name="web" depends="compile" description="GWT Web Compilation">
    <mkdir dir="${gwt.web.out.dir}"/>
    <java fork="true" maxmemory="256M" classpathref="gwt.path" classname="com.google.gwt.dev.Compiler">
     <classpath>
          <pathelement location="src"/>
           <!-- Note the reference to the compiled java classes -->
          <pathelement location="war/WEB-INF/classes"/>
        </classpath>

      <arg value="-war"/>
      <arg value="bin/www"/>
      <arg value="com/xxx/xxx/xx/xxx/xxx/GWT_DuplicateFinder"/>
    </java>
  </target>

The error I'm getting is :

[java] [ERROR] Unable to find 'com/xxx/xxx/xx/xxx/xxx/GWT_DuplicateFinder.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?

Could anyone tell me where I'm going wrong.

K2J
  • 2,573
  • 6
  • 27
  • 34

1 Answers1

0

Since the GWT compiler can not see the GWT_DuplicateFinder.gwt.xml file, there must be something wrong with the paths. You do have the src folder in the path, that is fine. So maybe the base directory or working directory is not correct (or not set at all).

Adrian B.
  • 4,333
  • 1
  • 24
  • 38