简体   繁体   中英

Compile GWT via Ant

Is it possible to run the GWT compiler (Java to JavaScript) and perhaps run other GWT tools (such as compile reports, run in dev mode, etc.) from an Ant buildfile? If so, where are these Ant tasks defined? I don't see anything in the SDK.

I can't imagine Google would make something as powerful as GWT and force developers to only run builds out of their local Eclipse instances...how do CI builds kick this stuff off?

Right there in the docs, Google tells you the command-line arguments for the Compiler, DevMode, JUnit, etc.

And of course, there's Command-line Tools , and it talks about the webAppCreator tool that generates an Ant build file. That tools is also presented in the Getting Started page (and goes on straight with using Ant as a build tool, not even talking about Eclipse) and the tutorial .

Is something like this you are looking for ?

   <target name="gwt-compile" depends="compile" description="GWT compile to JavaScript">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
    <classpath>
        <pathelement location="${src.dir}" />
        <pathelement location="${build.classes}" />
        <path refid="compile.classpath" />
        <path refid="gwt-dev.classpath" />
    </classpath>
    <jvmarg value="-Xmx256M" />
    <arg value="com.xxxx.xxx.xxx.xxx" />
</java>  
</target>

 <target name="devmode" depends="" description="Run development mode">
<java fork="true" classname="com.google.gwt.dev.DevMode" 
    dir="${basedir}/war" spawn="true">
    <classpath>
        <pathelement location="src" />
        <path refid="project.class.path" />
        <path refid="tools.class.path" />
    </classpath>
    <jvmarg value="-Xmx512M" />
    <jvmarg value="-javaagent:${appengine.folder}/lib/agent/appengine-agent.jar" />
    <jvmarg value="-Duser.dir=${basedir}/war" />
    <arg line="-war" />
    <arg value="${basedir}/war" />
    <arg line="-logLevel" />
    <arg value="INFO" />
    <arg value="-server" />
    <arg value="com.google.appengine.tools.development.gwt.AppEngineLauncher" />
    <arg value="net.bookedin.bam.BAM" />
</java>
</target>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM