<?xml version="1.0"?>
<!-- REBUILD.XML simple holidays build that presumes all files are already in the project directory. -->
<!-- Build with ant -f rebuild.xml zip jet -->
<!-- Compile and jar holidays using ANT -->
<!-- Invoke with [ant clean] to erase class files and start over. -->
<!-- Invoke with [ant compile] to just compile. -->
<!-- Invoke with [ant javadoc] to generate javadoc. -->
<!-- Invoke with [ant jar] to compile and create jar files. -->
<!-- Invoke with [ant jet] to create JET executables. -->
<!-- Invoke with [ant zip] to create source code zip files. -->
<!-- For details of ANT use, see http://mindprod.com/jgloss/ant.html -->

<!-- D E F I N I T I O N S -->
<!-- ANT.project.dir is com/mindprod/holidays -->
<!-- basedir is E:/ -->
<project name="holidays" basedir="E:/" default="jar">

<!-- extensions for zip. Case sensitive! -->
<property name="distributed.exts" value="**/*.au,**/*.asm,**/*.bat,**/*.btm,**/*.c,**/*.class,**/*.cpp,**/*.css,**/*.csv,**/*.dll,**/*.gif,**/*.h,**/*.hpp,**/*.htm,**/*.html,**/*.ico,**/*.ION,**/*.ion,**/*.jar,**/*.java,**/*.jnlp,**/*.jpg,**/*.look,**/*.png,**/*.properties,**/*.ser,**/*.sln,**/*.txt,**/*.use,**/*.vcproj,**/*.xml" />

<!-- dirs we to exclude from zip. Case sensitive! -->
<property name="nondistributed" value="**/jetpdb/**,**/Debug/**,**/Release/**" />

<!-- C L E A N -->
<target name="clean">
<echo message=":::    holidays    ::: deleting files to force regeneration" />
  <delete>
    <fileset dir="com/mindprod/holidays" includes="**/*.class" />
    <fileset dir="com/mindprod/holidays" includes="**/*.jar" />
    <fileset dir="com/mindprod/holidays" includes="holidays43.zip" />
  </delete>
</target>

<!-- C O M P I L E -->
<target name="compile">
<echo message=":::    holidays    ::: compiling tree." />
  <javac source="1.5" target="1.5" srcdir="com/mindprod/holidays" sourcepath="${basedir}" debug="on">
    <compilerarg value="-Xlint:unchecked" />
    <compilerarg value="-Xlint:fallthrough" />
    <compilerarg value="-Xlint:deprecation" />
  </javac>
</target>

<!-- J A V A H -->
<target name="javah" depends="compile">
  <!-- nothing to do -->
</target>

<!-- G A T H E R -->
<target name="gather" depends="compile">
<!-- nothing to do -->
</target>

<!-- J A R -->
<!-- Make apache-ant-1.7.1\lib\GenJar.jar known to ANT -->
<!-- See http://mindprod.com/jgloss/genjar.html for details -->
<taskdef resource="genjar.properties" />

<target name="jar" depends="gather">
 <echo message=":::    holidays    ::: genjar finding dependencies and creating jar." />
  <genjar jarfile="com/mindprod/holidays/holidays.jar">
    <!-- include main class and all its dependencies -->
    <class name="com.mindprod.holidays.Holidays" />
    <!-- Extra classes and properties to include in holidays.jar -->
    <!-- include all the dynamically loaded classes in com.mindprod.holidays dir -->
    <class>
        <fileset dir="${basedir}">
        <include name="com/mindprod/holidays/*.class" />
        </fileset>
    </class>

    <!-- include a properties file as a resource -->
    <resource file="com/mindprod/holidays/Holiday.properties" package="com.mindprod.holidays" />

    <!-- define the manifest -->
    <manifest>
      <attribute name="Main-Class" value="com.mindprod.holidays.Holidays" />
    </manifest>
  </genjar>
  <!-- build exportholidays.jar -->
  <genjar jarfile="com/mindprod/holidays/exportholidays.jar">
    <class name="com.mindprod.holidays.ExportHolidays" />
    <!-- Extra classes and properties to include in exportholidays.jar -->
    <!-- include all the dynamically loaded classes in com.mindprod.holidays dir -->
    <class>
        <fileset dir="${basedir}">
        <include name="com/mindprod/holidays/*.class" />
        </fileset>
    </class>

    <!-- include a properties file as a resource -->
    <resource file="com/mindprod/holidays/Holiday.properties" package="com.mindprod.holidays" />

    <!-- define the  manifest -->
    <manifest>
      <attribute name="Main-Class" value="com.mindprod.holidays.ExportHolidays" />
    </manifest>
  </genjar>
</target>

<!-- P O S T J A R -->
<target name="postjar" depends="jar">
  <!-- nothing to do -->
</target>

<!-- P R E J E T -->
<target name="prejet">
<echo message=":::    holidays    ::: avoid regenerating Jet executable if already done" />
  <uptodate property="jet.uptodate" srcfile="com/mindprod/holidays/holidays.jar" targetfile="com/mindprod/holidays/holidays.exe" />
</target>

<!-- J E T -->
<!-- Requires Excelsior JET native Java compiler jc.exe on the path -->
<!-- See http://mindprod.com/jgloss/jet.html for details -->
<target name="jet" depends="prejet" unless="jet.uptodate">
<echo message=":::    holidays    ::: jet compiling." />
  <exec executable="jc.exe" dir="com/mindprod/holidays">
    <arg value="-DECOR=" />
    <arg value="holidays.jar" />
  </exec>
  <exec executable="jc.exe" dir="com/mindprod/holidays">
    <arg value="-DECOR=" />
    <arg value="exportholidays.jar" />
  </exec>
</target>

<!-- P R E J A V A D O C . -->
<target name="prejavadoc">
<echo message=":::    holidays    ::: avoid regenerating Javadoc if already done" />
  <uptodate property="javadoc.uptodate" targetfile="com/mindprod/holidays/javadoc/index.html">
    <srcfiles dir="com/mindprod/holidays" includes="**/*.java" />
  </uptodate>
</target>

<!-- J A V A D O C -->
<target name="javadoc" depends="prejavadoc" unless="javadoc.uptodate">
<echo message=":::    holidays    ::: generating Javadoc" />
  <!-- prepare javadoc -->
  <javadoc
    author="true"
    destdir="com/mindprod/holidays/javadoc"
    packagenames="com.mindprod.holidays.*"
    sourcepath="E:/"
    use="true"
    version="true" />
</target>

<!-- Z I P -->
<target name="zip" depends="javadoc,jar">
<echo message=":::    holidays    ::: preparing zip distributable" />
  <!-- Remove references to separate foot files. -->
  <exec executable="prunefoot.exe" failifexecutionfails="false" dir="com/mindprod/holidays">
    <arg value="holidays.html" />
    <arg value="holidays.manual.html" />
  </exec>
  <zip destfile="com/mindprod/holidays/holidays43.zip" duplicate="preserve" filesonly="true" includes="${distributed.exts}" excludes="${nondistributed}">
    <!-- zipfileset includes all subdirs as well -->
    <zipfileset dir="com/mindprod/holidays" prefix="com/mindprod/holidays" includes="${distributed.exts}" excludes="${nondistributed}" />
    <zipfileset dir="com/mindprod/common11" prefix="com/mindprod/common11" includes="${distributed.exts}" excludes="${nondistributed}" />
    <zipfileset dir="com/mindprod/ledatastream" prefix="com/mindprod/ledatastream" includes="${distributed.exts}" excludes="${nondistributed}" />
    <zipfileset dir="com/mindprod/common13" prefix="com/mindprod/common13" includes="${distributed.exts}" excludes="${nondistributed}" />
    <zipfileset dir="com/mindprod/common15" prefix="com/mindprod/common15" includes="${distributed.exts}" excludes="${nondistributed}" />
    <!-- Extra classes and properties to include in the Zip -->
    <zipfileset dir="com/mindprod/entities" prefix="com/mindprod/entities" includes="${distributed.exts}" excludes="${nondistributed}" />

  </zip>
</target>

<!-- P O S T Z I P -->
<target name="postzip" depends="zip,postjar">
  <!-- nothing to do -->
</target>
</project>