Generic Ant Task

14 views
Skip to first unread message

thelifter

unread,
May 17, 2006, 5:56:11 PM5/17/06
to Google Web Toolkit
I needed to integrate javascript compilation into a larger Ant build
process and this snippet did the trick.

<target name="ajax-compile">

<java classpathref="compile.gwt"
fork="true"
dir="C:/gwt-windows-1.0.20"
classname="com.google.gwt.dev.GWTCompiler">
<arg value="-out"/>
<arg value="${gwt.output}"/>
<arg value="%*"/>
<arg
value="com.shoptick.financials.ajax.client.FinancialDocumentInterface"/>
</java>

</target>


Just make sure the classpath referred to by compile.gwt includes the
gwt jars and the the source for your entry point class and its
dependencies. Perhaps someone from google will let me know if this is
an unforgivable hack or not.

Mat Gessel

unread,
May 18, 2006, 2:48:25 AM5/18/06
to Google Web Toolkit
Thanks for the tip. It also works if you remove the java "dir" and "%*"
arg. Here is my modified and script.

<path id="gwt.classpath">
<pathelement location="${project.dir}/src"/>
<pathelement location="${gwt.sdk.location}/gwt-user.jar"/>
<pathelement location="${gwt.sdk.location}/gwt-dev-windows.jar"/>
</path>

<target name="compile">
<java classpathref="gwt.classpath"
classname="com.google.gwt.dev.GWTCompiler"
fork="true">
<arg value="-out"/>
<arg value="${output.dir}"/>
<arg value="${entry.point.class}"/>
</java>
</target>

Reply all
Reply to author
Forward
0 new messages