Ant tasks for compiling GWT javascript?

104 views
Skip to first unread message

jdpl28

unread,
Nov 2, 2007, 8:19:18 AM11/2/07
to Google Web Toolkit
Hi,

I'm trying to integrate a GWT project into our ANT build system, and
was wondering is there any tasks written to do this? Also is there any
documentation on this kind of thing?

thanks,
Justin

walrus

unread,
Nov 2, 2007, 8:27:56 AM11/2/07
to Google Web Toolkit
I am using a simple macro to run GWT compiler. However, having a
proper GWT task that would analyze whether source files were changed
would be a great thing. I'm not sure if anyone has implemented such a
task.

<macrodef name="gwtc">
<attribute name="module"/>
<sequential>
<echo message="gwtc: @{module}" />
<java classname="com.google.gwt.dev.GWTCompiler"
fork="true">
<arg value="-logLevel"/>
<arg value="WARN"/>
<!--arg value="-style"/>
<arg value="PRETTY"/-->
<arg value="-out"/>
<arg value="../${moysklad.build.dir}/$
{ant.project.name}/web"/>
<arg value="@{module}"/>
<jvmarg value="-Xmx192m" />
<jvmarg value="-Xms128m" />
<classpath refid="gwt.classpath"/>
</java>
</sequential>
</macrodef>

Martin

unread,
Nov 2, 2007, 8:28:44 AM11/2/07
to Google Web Toolkit
hi

<target name="gwt.compile.module">


<java classname="com.google.gwt.dev.GWTCompiler" fork="true">

<jvmarg value="-Xmx256M"/>
<arg value="-out"/>
<arg value="${www.dir}"/>
<arg value="${gwt.module}"/>
<classpath>
<pathelement location="${base}/src"/>
<pathelement location="${base}/lib/gwt-user.jar"/>
<pathelement location="${gwt.home}/gwt-dev-${platform}.jar"/>
</classpath>
</java>
</target>

ronald mathies

unread,
Nov 2, 2007, 8:29:05 AM11/2/07
to Google-We...@googlegroups.com
I use ant for building the pages in the following way:


<java classname="com.google.gwt.dev.GWTCompiler" fork="true">
            <arg value="-out"/>
            <arg value="${ static.dir}"/>
            <arg value="%*"/>
            <arg value="com.mycompany.Application"/>
            <arg value="-logLevel"/>
            <arg value="TRACE"/>
            <classpath>
                <path refid="project.class.path"/>
            </classpath>
        </java>

the ${static.dir} is the folder where the generated pages go to (normally this is the folder with the name "static"> the com.mycompany.Application is your module name. The class path for me is:

<path id="project.class.path">
       
            <!-- External libraries -->
            <pathelement location="${ lib.dir}spring.jar"/>
            <pathelement location="${lib.dir}gwtext.jar"/>
            <pathelement location="${lib.dir}gwt-user.jar"/>
            <pathelement location="${ lib.dir}gwt-servlet.jar"/>
            <pathelement location="${lib.dir}gwt-dev-windows.jar"/>
            <pathelement location="${lib.dir}gwt-sl.jar"/>
            <pathelement location="${ lib.dir}cglib-nodep-2.1_3.jar"/>
            <pathelement location="${lib.dir}gwt-google-apis.jar"/>
            <pathelement location="${lib.dir}log4j-1.2.14.jar"/>
            <pathelement location="${ lib.dir}googlemaps_gwt_2_2_1.jar"/>
            <!-- Client source dir -->
            <pathelement location="${client.dir}"/>
           
            <!-- Server source dir -->
            <pathelement location="${server.dir}"/>
        </path>   
Reply all
Reply to author
Forward
0 new messages