<?xml version="1.0" encoding="utf-8" ?>
<project name="j2js" default="build" basedir=".">

  <property name="gwt.sdk" location="../.." />
  <property name="module_name" location="j2js" />

  <path id="project.class.path">
    <pathelement location="war/WEB-INF/classes"/>
    <pathelement location="${gwt.sdk}/gwt-user.jar"/>
    <fileset dir="${gwt.sdk}" includes="gwt-dev*.jar"/>
  </path> 

  <target name="javac" depends="" description="Compile java source">
    <mkdir dir="war/WEB-INF/classes"/>
    <javac srcdir="src" includes="**" encoding="utf-8"
        destdir="war/WEB-INF/classes"
        source="1.5" target="1.5" nowarn="true"
        debug="true" debuglevel="lines,vars,source">
      <classpath refid="project.class.path"/>
    </javac>
  </target>

  <target name="gwtc" depends="javac" description="GWT compile to JavaScript">

    <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
      <classpath>
        <pathelement location="src"/>
        <path refid="project.class.path"/>
      </classpath>
      <jvmarg value="-Xmx256M"/>
      <arg value="-style"/>
      <arg value="DETAILED"/>
      <arg value="-logLevel"/>
      <arg value="INFO"/>
      <arg value="j2js"/>
    </java>
  </target>

  <target name="postprocess" depends="gwtc" description="postprocess javascript" >
	<exec input="war/j2js/j2js.nocache.js" output="war/j2js/j2js.js" dir="war/j2js" executable="python" failonerror="yes">
		<arg value="../../tools/postprocess.py" />
		<arg value="j2js" />
	</exec>
  </target>

  <target name="build" depends="postprocess" description="Build this project" />

  <target name="clean" description="Cleans this project">
    <delete dir="war" failonerror="false" />
  </target>

</project>

