<?xml version="1.0" encoding="UTF-8"?>
<!-- Builds the "JHotDraw BezierDemo" demo application and demo applet. -->
<project name="build-AVIDemo" default="all" basedir=".">
    <target name="init">
        <property name="libdir" value="lib"/>
        <property name="srcdir" value="src/main"/>
        <property name="rscdir" value="resources"/>
        <property name="builddir" value="build"/>
        <property name="classdir" value="${builddir}/classes"/>
        <property name="distdir" value="dist/AVIDemo"/>
        <property name="author" value="Werner Randelshofer"/>
        <property name="version" value="0.5"/>
        <property name="versionDate" value="2012-03-28"/>
        <property name="versionLong" value="${version} ${versionDate}"/>
    </target>
    <target name="clean" depends="init">
        <delete dir="${classdir}" />
    </target>
    <target name="application.compile" depends="init,clean">
        <mkdir dir="${classdir}"/>
        <javac
                destdir="${classdir}"
                srcdir="${srcdir}"
                debug="true"
                source="1.5"
                target="1.5"
                optimize="true"
                encoding="UTF-8"
                includeantruntime="false"
         >
            <compilerarg value="-Xlint:unchecked"/>
            
            <include name="org/monte/avidemo/Main.java"/> 
            <include name="org/monte/media/avi/DIBCodec.java"/> 
            <include name="org/monte/media/avi/RunLengthCodec.java"/> 
            <include name="org/monte/media/avi/TechSmithCodec.java"/> 
            <include name="org/monte/media/jpeg/JPEGCodec.java"/> 
            <include name="org/monte/media/png/PNGCodec.java"/> 
        </javac>
        <copy todir="${classdir}">
            <fileset dir="${srcdir}" >
                <include name="org/monte/avidemo/*.java"/>
                <include name="org/monte/media/AbstractCodec.java"/>
                <include name="org/monte/media/AbstractVideoCodec.java"/>
                <include name="org/monte/media/Buffer.java"/>
                <include name="org/monte/media/Codec.java"/>
                <include name="org/monte/media/Format.java"/>
                <include name="org/monte/media/VideoFormat.java"/>
                <include name="org/monte/media/avi/*.java"/>
                <include name="org/monte/media/io/ByteArrayImageOutputStream.java"/>
                <include name="org/monte/media/io/ImageOutputStreamAdapter.java"/>
                <include name="org/monte/media/io/SeekableByteArrayOutputStream.java"/>
                <exclude name="**/.*"/>
            </fileset>
        </copy>
    </target>
    <target name="application.jar" depends="init,application.compile">
        <mkdir dir="${distdir}"/>
        <copy file="${rscdir}/avidemo_license.html" tofile="${classdir}/license.html" />
        <jar destfile="${distdir}/AVIDemo.jar" basedir="${classdir}">
            <manifest>
                <attribute name="Built-By" value="${author}"/>
                <attribute name="Main-Class" value="org.monte.avidemo.Main"/>
                <attribute name="Implementation-Version" value="${versionLong}"/>
            </manifest>
        </jar>
    </target>
    <target name="application.run-jar" depends="init">
        <java fork="true" jar="${distdir}/AVIDemo.jar">
            <jvmarg value="-Xdock:name=AVIDemo"/>
            <jvmarg value="-Dlocale=en"/>
            <jvmarg value="-Dapple.awt.graphics.UseQuartz=false"/>
            <jvmarg value="-Djava.library.path=${libdir}"/>
        </java>
    </target>
    <target name="dist" depends="init,application.jar">
    </target>
</project>
