Back when GWT was all new and shiny (almost three years ago), I played with it and put together a tiny library of Ant tasks - nothing earth-shattering, really basically only a few macrodefs over Ant's java task.

Strangely I still get quite a few hits by searches for "GWT and Ant", so it seems as if nobody else has given GWT and Ant integration a try.

I don't use GWT. Not at all. When I create webapps at $JOB GWT isn't the right choice, either its technology is no fit (we mainly are a .NET shop after all) or the layout requirements can't be achieved by any component based framework I've tried (so far it is Velocity at the view layer for me).

Almost exactly two years ago Fernando Meyer sent me a patch to the Antlib that changed the hard coded directory names for source and destination into attributes on the gwt:shell and gwt:compile tasks. About a year ago I was asked how one could increase the memory size for gwt:compile. Somewhere very deeply buried on my TODO list I took note of them.

When I woke up this morning Apache's svn was read-only and suddenly I had time (I planned to hack on Gump) but no ASF project to keep me occupied so I finally managed to integrate Fernando's patch and make room for arbitrary extension arguments.

Code and sources are here and while I was at it, there is a darcs repository1 for it (I've been using darcs for years and didn't feel like installing a different SCM backend).

gwt:compile and gwt:shell have new attributes sourcedir that default to the old hard-coded value "src" for the source directory and both have a new nested element jvmargs that can be used to pass arbitrary nested elements supported by Ant's java task to the underlying task. I.e. one can now write

    <gwt:compile outDir="www" gwtHome="${gwt.home}"
                 classBase="de.samaflost.gwt.Foo">
      <gwt:jvmargs>
        <jvmarg value="-Xmx1024m"/>
      </gwt:jvmargs>
    </gwt:compile>

in order to bump the max memory to one gig. gwt:shell now also has an optional bindir attribute defaulting to the old hard-coded "bin".

The Antlib has seen some minimal manual testing against GWT 1.5.

It should be obvious that I don't really maintain these tasks, and to be honest I don't expect I'll ever do. If anybody wants to fork the code, reuse it, whatever, feel free to do so. If you are planning to maintain a more useful Ant integration than my hackish version did, please let me know so I can send people looking for "GWT and Ant" your way.

[1] The directory is not browseable, use

darcs get http://stefan.samaflost.de/repos/gwttasks/

in order to grab the contents.

path: /en/Java/GWT | #