通过Ant编译GWT



是否可以从Ant构建文件运行GWT编译器(Java到JavaScript),或者运行其他GWT工具(如编译报告、在开发模式下运行等)?如果是,这些Ant任务在哪里定义?我在SDK中没有看到任何内容。

我无法想象谷歌会做出像GWT这样强大的东西,并迫使开发人员只能在本地Eclipse实例中运行构建。。。CI构建如何启动这些内容?

在文档中,Google将告诉您编译器、DevMode、JUnit等的命令行参数

  • 开发模式选项
  • GWT编译器选项
  • 启动代码服务器(超级开发人员模式)
  • 运行JUnit测试用例(搜索TestRunner

当然,还有命令行工具,它谈到了生成Ant构建文件的webAppCreator工具。这些工具也出现在Getting Started页面(并直接使用Ant作为构建工具,甚至不谈论Eclipse)和教程中。

你在找这样的东西吗?

   <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>

最新更新