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?
The heart of GWT is a compiler that converts Java source into JavaScript, transforming your working Java application into an equivalent JavaScript application. The GWT compiler supports the vast majority of the Java language. The GWT runtime library emulates a relevant subset of the Java runtime library.
Debugging a GWT application in development mode is easy. In this case you can just debug the Java code. Put a breakpoint into your code and start the debugger via selecting your project, right-click → debug as → Web Application. You can then use standard Eclipse debugging capabilities.
It is important to remember that the target language of your GWT application is ultimately JavaScript, so there are some differences between running your application in dev-mode, superdev-mode, and production mode.
Right there in the docs, Google tells you the command-line arguments for the Compiler, DevMode, JUnit, etc.
TestRunner
)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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With