GWT 1.6 Build Migration
April 8, 2009 at 9:11 pm | In Build, Java, Software Development, Web | 2 CommentsTags: Ant, Build, Compilation, GWT, GWT 1.5, GWT 1.6, GWT Compiler, Web
GWT 1.6 final officially got released yesterday. Most of you guys probably already have a GWT application sitting around that you want to upgrade from 1.5 to 1.6 to fully leverage the new features. One of the biggest changes is the structure of the WAR file. The public directory that got generated in 1.5 by running the projectCreator and applicationCreator tools does not exist anymore. HTML and CSS files will sit in the root directory of your WAR file. To convert your project have a look at the proposed project structure and apply it to your project. In your Ant build file you might have something similar to this one (assume that the WAR file got build before in a different target):
<path id="gwt.classpath">
<pathelement location="src"/>
<fileset dir="${libs.dir}/gwt/gwt-1.5.3">
<include name="gwt-user.jar"/>
<include name="gwt-dev-linux.jar"/>
<include name="gwt-dev-mac.jar"/>
<include name="gwt-dev-windows.jar"/>
</fileset>
</path>
<target name="compile-gwt">
<java classname="com.google.gwt.dev.GWTCompiler" fork="true">
<arg line="-out ${gwt.compile.out}" />
<arg value="${gwt.module}" />
<arg line="-style ${gwt.style}" />
<classpath refid="gwt.classpath"/>
</java>
</target>
<target name="gwtify-war">
<!-- We don't need the GWT compiler tmp files-->
<delete dir="${gwt.compile.out}/.gwt-tmp"/>
<zip destfile="${operations-consoleweb.path.jar}"
update="true">
<fileset dir="${gwt.compile.out}">
<include name="**/*.*"/>
</fileset>
</zip>
</target>
With the new version of the GWT compiler the temporary directory .gwt-tmp, as a by-product of the compilation process, is not being generated anymore. Use the new compiler class name com.google.gwt.dev.Compiler and you should be done.
<path id="gwt.classpath">
<pathelement location="src"/>
<fileset dir="${libs.dir}/gwt/gwt-1.6.4">
<include name="gwt-user.jar"/>
<include name="gwt-dev-linux.jar"/>
<include name="gwt-dev-mac.jar"/>
<include name="gwt-dev-windows.jar"/>
</fileset>
</path>
<target name="compile-gwt">
<java classname="com.google.gwt.dev.Compiler" fork="true">
<classpath>
<path refid="operations-console.module.sourcepath"/>
<path refid="gwt.classpath"/>
</classpath>
<jvmarg value="-Xmx256M"/>
<arg value="${gwt.module}"/>
</java>
</target>
2 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.

Can you please explain to me haw to setup gwt1.6.4 throwout an example project. I used yet gwt1.5.3 but when I have to migrate to the new version I have a problem to run examples.
Thx
Comment by sotuxan — April 29, 2009 #
GWT 1.6.4 has a new project structure. Make sure you have your HTML/CSS in the “war” directory. Also the compiled GWT files have to go under that directory. GWT libraries have to go in “war/WEB-INF/lib”, web.xml in “war/WEB-INF”. What’s your IDE? Do you use a GWT plugin? If you’re using Eclipse definitely go for the Google plugin. It will help you set up a GWT project from scratch correctly. Do you get a specific error message when trying to run the example? Are you running the example in hosted mode or in a separate web container?
Comment by Ben — April 29, 2009 #