blob: f2c1e8deaeeaebe459d16b09a0c239a8102b3bcb [file] [log] [blame]
<project name="codeserver" default="build" basedir=".">
<property name="gwt.root" location="../.." />
<property name="project.tail" value="dev/codeserver" />
<import file="${gwt.root}/common.ant.xml" />
<property.ensure name="gwt.dev.jar" location="${gwt.build.lib}/gwt-dev.jar" />
<!-- location of preprocessed source -->
<property name="src" value="${project.build}/src" />
<!--
Nasty hack to fix the source code for the open source build.
Constraint: the code in the "java/" directory is how we want it inside Google.
But outside Google, Jetty is not repackaged, so we need to fix the import statements.
(The right way to do this is probably to repackage Jetty.)
-->
<target name="preprocess">
<delete dir="${src}"/>
<mkdir dir="${src}"/>
<copy todir="${src}">
<fileset dir="java">
<include name="**/*.java"/>
</fileset>
</copy>
<replace dir="${src}" token="com.google.gwt.thirdparty.org.mortbay.jetty"
value="org.mortbay.jetty"/>
</target>
<target name="compile" depends="preprocess">
<mkdir dir="${javac.out}" />
<gwt.javac srcdir="${src}">
<classpath>
<pathelement location="${gwt.dev.jar}" />
</classpath>
</gwt.javac>
</target>
<target name="build" depends="compile" description="builds gwt-codeserver.jar">
<gwt.jar>
<fileset dir="${src}" />
<fileset dir="${javac.out}"/>
<fileset dir="java">
<include name="**/*.html"/>
<include name="**/*.js"/>
</fileset>
<manifest>
<!-- why doesn't this work?
<attribute name="Class-Path" value="gwt-dev.jar gwt.user.jar" />
-->
<attribute name="Main-Class" value="com.google.gwt.dev.codeserver.CodeServer" />
</manifest>
</gwt.jar>
</target>
<!-- no-op for now -->
<target name="verify"/>
<target name="demo" depends="build" description="starts the code server with a sample app">
<property.ensure name="gwt.user.jar" location="${gwt.build.lib}/gwt-user.jar" />
<property.ensure name="sample-src" location="${gwt.root}/samples/hello/src" />
<java fork="true" failonerror="true" classname="com.google.gwt.dev.codeserver.CodeServer">
<classpath>
<pathelement location="${project.lib}"/>
<pathelement location="${gwt.dev.jar}"/>
<pathelement location="${gwt.user.jar}"/>
</classpath>
<arg value="-src"/>
<arg value="${sample-src}"/>
<arg value="com.google.gwt.sample.hello.Hello"/>
</java>
</target>
</project>