<?xml version="1.0" standalone="yes"?>
<!--
  Copyright 2004 Sun Microsystems, Inc. All rights reserved.
-->
<project basedir="." default="run">
  <description>
        This sample application illustrate some of the DTD support available in 
        the JAXB RI's extension mode. Please refer to the &lt;a href="vendor.html&gt;
        Vendor Extensions&lt;/a&gt; page for more detail.
    </description>
  <property name="jaxb.home" value="../.." />
  <path id="classpath">
    <pathelement path="src" />
    <pathelement path="classes" />
    <pathelement path="schemas" />
    <fileset dir="${jaxb.home}" includes="lib/*.jar" />
  </path>
  <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
    <classpath refid="classpath" />
  </taskdef>

  <!--compile Java source files-->
  <target name="compile" description="Compile all Java source files">
    <echo message="Compiling the schema..." />
    <mkdir dir="gen-src" />
    <xjc schema="log4j.dtd" binding="log4j.jaxb" destdir="gen-src">
      <arg value="-dtd" />
      <produces dir="gen-src" includes="**/*.java" />
    </xjc>
    <echo message="Compiling the java source files..." />
    <mkdir dir="classes" />
    <javac destdir="classes" debug="on">
      <src path="src" />
      <src path="gen-src" />
      <classpath refid="classpath" />
    </javac>
  </target>

  <target name="run" depends="compile" description="Run the sample app">
    <echo message="Running the sample application..." />
    <java classname="DTDSample" fork="true">
      <classpath refid="classpath" />
      <arg path="log4j.xml" />
    </java>
  </target>

  <target name="javadoc" description="Generates javadoc" depends="compile">
    <echo message="Generating javadoc..." />
    <mkdir dir="docs/api" />
    <javadoc sourcepath="gen-src" destdir="docs/api" windowtitle="dtd" useexternalfile="yes">
      <fileset dir="." includes="gen-src/**/*.java" excludes="**/impl/**/*.java" />
    </javadoc>
  </target>

  <target name="clean" description="Deletes all the generated artifacts.">
    <delete dir="docs/api" />
    <delete dir="gen-src" />
    <delete dir="schemas" />
    <delete dir="classes" />
  </target>
</project>

