此内容没有您所选择的语言版本。
25.4. GWT Ant Targets
To deploy GWT applications, you must also perform compilation to JavaScript. This compacts and obfuscates the code. You can use an Ant utility instead of the command line or GUI utility provided by GWT. To do so, you must have GWT downloaded, and the Ant task
JAR
in your Ant classpath.
Place the following near the top of your Ant file:
<taskdef uri="antlib:de.samaflost.gwttasks" resource="de/samaflost/gwttasks/antlib.xml" classpath="./lib/gwttasks.jar"/> <property file="build.properties"/>
<taskdef uri="antlib:de.samaflost.gwttasks"
resource="de/samaflost/gwttasks/antlib.xml"
classpath="./lib/gwttasks.jar"/>
<property file="build.properties"/>
Create a
build.properties
file containing:
gwt.home=/gwt_home_dir
gwt.home=/gwt_home_dir
This must point to the directory in which GWT is installed. Next, create a target:
When called, this target compiles the GWT application and copies it to the specified directory (likely in the
webapp
section of your WAR).
Note
Never edit the code generated by
gwt-compile
— if you need to edit, do so in the GWT source directory.
We highly recommend using the hosted mode browser included in the GWT if you plan to develop applications with the GWT.