<?xml version="1.0" encoding="UTF-8"?>
<!-- Builds the "JHotDraw BezierDemo" demo application and demo applet. -->
<project name="build-screenrecorder" default="all" basedir=".">
    <target name="init">
        <property name="libdir" value="lib"/>
        <property name="srcdir" value="src/main"/>
        <property name="rscdir" value="resources/recorder"/>
        <property name="builddir" value="build"/>
        <property name="classdir" value="${builddir}/classes"/>
        <property name="distdir" value="dist/ScreenRecorder"/>
        <property name="author" value="Werner Randelshofer"/>
        <property name="version" value="0.6.8"/>
        <property name="versionDate" value="2012-04-26"/>
        <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.6"
                target="1.6"
                optimize="true"
                encoding="UTF-8"
                includeantruntime="false"
                 >
            <include name="ScreenRecorder.java"/>
            <include name="org/monte/media/avi/AVIPCMAudioCodec.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"/>
            <include name="org/monte/media/quicktime/AnimationCodec.java"/>
            <include name="org/monte/media/quicktime/RawCodec.java"/>
            <include name="org/monte/media/quicktime/QuickTimePCMAudioCodec.java"/>
        </javac>

        <copy todir="${classdir}">
            <fileset dir="${srcdir}" >
                <include name="ScreenRecorder.java"/>
                <include name="org/monte/media/audio/PCMAudioCodec.java"/>
                <include name="org/monte/media/avi/AVIBMPDIB.java"/>
                <include name="org/monte/media/avi/AVIOutputStream.java"/>
                <include name="org/monte/media/avi/AVIPCMAudioCodec.java"/>
                <include name="org/monte/media/avi/AVIWriter.java"/>
                <include name="org/monte/media/avi/AbstractAVIStream.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/avi/TechSmithCodecCore.java"/>
                <include name="org/monte/media/avi/package-info.java"/>
                <include name="org/monte/media/beans/AbstractStateModel.java"/>
                <include name="org/monte/media/color/Colors.java"/>
                <include name="org/monte/media/color/package-info.java"/>
                <include name="org/monte/media/converter/CodecChain.java"/>
                <include name="org/monte/media/converter/ScaleImageCodec.java"/>
                <include name="org/monte/media/converter/package-info.java"/>
                <include name="org/monte/media/gui/Worker.java"/>
                <include name="org/monte/media/gui/package-info.java"/>
                <include name="org/monte/media/image/Images.java"/>
                <include name="org/monte/media/image/package-info.java"/>
                <include name="org/monte/media/gui/images/Cursor.*.png"/>
                <include name="org/monte/media/io/ByteArrayImageInputStream.java"/>
                <include name="org/monte/media/io/ByteArrayImageOutputStream.java"/>
                <include name="org/monte/media/io/ImageInputStreamImpl2.java"/>
                <include name="org/monte/media/io/ImageInputStreamAdapter.java"/>
                <include name="org/monte/media/io/ImageOutputStreamAdapter.java"/>
                <include name="org/monte/media/io/SeekableByteArrayOutputStream.java"/>
                <include name="org/monte/media/io/SubImageOutputStream.java"/>
                <include name="org/monte/media/io/UncachedImageInputStream.java"/>
                <include name="org/monte/media/io/package-info.java"/>
                <include name="org/monte/media/jpeg/JPEGCodec.java"/>
                <include name="org/monte/media/jpeg/MJPGImageReader.java"/>
                <include name="org/monte/media/jpeg/MJPGImageReaderSpi.java"/>
                <include name="org/monte/media/jpeg/package-info.java"/>
                <include name="org/monte/media/math/IntMath.java"/>
                <include name="org/monte/media/math/Rational.java"/>
                <include name="org/monte/media/png/PNGCodec.java"/>
                <include name="org/monte/media/png/package-info.java"/>
                <include name="org/monte/media/quicktime/AbstractQuickTimeStream.java"/>
                <include name="org/monte/media/quicktime/AnimationCodec.java"/>
                <include name="org/monte/media/quicktime/DataAtomOutputStream.java"/>
                <include name="org/monte/media/quicktime/QuickTimeOutputStream.java"/>
                <include name="org/monte/media/quicktime/QuickTimePCMAudioCodec.java"/>
                <include name="org/monte/media/quicktime/QuickTimeWriter.java"/>
                <include name="org/monte/media/quicktime/Codec.java"/>
                <include name="org/monte/media/quicktime/package-info.java"/>
                <include name="org/monte/media/quicktime/RawCodec.java"/>
                <include name="org/monte/media/riff/RIFFChunk.java"/>
                <include name="org/monte/media/riff/RIFFParser.java"/>
                <include name="org/monte/media/riff/RIFFPrimitivesInputStream.java"/>
                <include name="org/monte/media/riff/RIFFVisitor.java"/>
                <include name="org/monte/media/util/Methods.java"/>
                <include name="org/monte/media/AbortException.java"/>
                <include name="org/monte/media/AbstractCodec.java"/>
                <include name="org/monte/media/AbstractAudioCodec.java"/>
                <include name="org/monte/media/AbstractVideoCodec.java"/>
                <include name="org/monte/media/AbstractVideoCodecCore.java"/>
                <include name="org/monte/media/AudioFormatKeys.java"/>
                <include name="org/monte/media/Buffer.java"/>
                <include name="org/monte/media/BufferFlag.java"/>
                <include name="org/monte/media/Codec.java"/>
                <include name="org/monte/media/DefaultRegistry.java"/>
                <include name="org/monte/media/FileFormat.java"/>
                <include name="org/monte/media/Format.java"/>
                <include name="org/monte/media/FormatKey.java"/>
                <include name="org/monte/media/FormatKeys.java"/>
                <include name="org/monte/media/MovieReader.java"/>
                <include name="org/monte/media/MovieWriter.java"/>
                <include name="org/monte/media/Multiplexer.java"/>
                <include name="org/monte/media/ParseException.java"/>
                <include name="org/monte/media/Registry.java"/>
                <include name="org/monte/media/VideoFormat.java"/>
                <include name="org/monte/media/VideoFormatKeys.java"/>
                <include name="org/monte/media/package-info.java"/>
                <include name="org/monte/screenrecorder/*.java"/>
                <include name="org/monte/screenrecorder/*.form"/>
                <exclude name="**/.*"/>
            </fileset>
        </copy>
    </target>
    <target name="application.jar" depends="init,application.compile">
        <mkdir dir="${distdir}"/>
        <copy todir="${classdir}" >
            <fileset dir="${rscdir}/license"/>
         </copy>
        <copy todir="${distdir}" >
            <fileset dir="${rscdir}/scripts"/>
         </copy>
         <chmod dir="${distdir}" perm="+x" includes="*.command">
         </chmod>
        <jar destfile="${distdir}/ScreenRecorder.jar" basedir="${classdir}">
            <manifest>
                <attribute name="Built-By" value="${author}"/>
                <attribute name="Main-Class" value="ScreenRecorder"/>
                <attribute name="Implementation-Version" value="${versionLong}"/>
            </manifest>
        </jar>
    </target>
    <target name="application.run-jar" depends="init">
        <java fork="true" jar="${distdir}/ScreenRecorder.jar">
            <jvmarg value="-Xdock:name=ScreenRecorder"/>
            <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>
