Generic Ant Task

瀏覽次數:14 次
跳到第一則未讀訊息

thelifter

未讀,
2006年5月17日 下午5:56:112006/5/17
收件者: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

未讀,
2006年5月18日 凌晨2:48:252006/5/18
收件者: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>

回覆所有人
回覆作者
轉寄
0 則新訊息