<!-- ======================================================================= -->
<!-- Tutorial Build file.                                                    -->
<!-- Copyright (C) 2003-2012 Smardec. All rights reserved.                   -->
<!-- http://www.smardec.com                                                  -->
<!-- ======================================================================= -->
<project name="ASC" default="dist" basedir=".">
    <target name="init">
        <tstamp>
            <format property="build.time" pattern="dd/MM/yyyy"/>
        </tstamp>
        <property name="ASC.lib" value="../lib"/>
        <property name="ASC.src" value="src"/>
        <property name="ASC.build" value="build"/>
        <property name="ASC.build.classes" value="build/classes"/>
        <property name="ASC.demo.images" value="com/smardec/demo/asc/img"/>
        <property name="ASC.dist" value="lib"/>
        <property name="ASC.jar.demo" value="demo.jar"/>

        <path id="project.class.path">
            <pathelement location="${ASC.lib}"/>
            <fileset dir="${ASC.lib}">
                <include name="**/*.jar"/>
            </fileset>
            <pathelement location="${ASC.build.classes}"/>
        </path>
    </target>

    <target name="prepare" depends="init">
        <mkdir dir="${ASC.build}"/>
        <mkdir dir="${ASC.build.classes}"/>
        <mkdir dir="${ASC.dist}"/>
    </target>

    <target name="compile" depends="prepare">
        <depend srcdir="${ASC.src}" destdir="${ASC.build.classes}" closure="yes"/>
        <javac srcdir="${ASC.src}" destdir="${ASC.build.classes}" debug="on">
            <classpath refid="project.class.path"/>
        </javac>
    </target>

    <target name="jar" depends="compile">
        <mkdir dir="${ASC.build.classes}/${ASC.demo.images}"/>
        <copy todir="${ASC.build.classes}/${ASC.demo.images}">
            <fileset dir="${ASC.src}/${ASC.demo.images}"/>
        </copy>

        <copy todir="${ASC.build.classes}/com/smardec/demo/asc">
            <fileset dir="${ASC.src}/com/smardec/demo/asc">
                <include name="demos.xml"/>
                <include name="menutoolbar.xml"/>
                <include name="filechoosers.xml"/>
            </fileset>
        </copy>

        <jar jarfile="${ASC.dist}/${ASC.jar.demo}" manifest="${ASC.src}/manifest.mf">
            <fileset dir="${ASC.build.classes}">
                <include name="com/smardec/demo/asc/**"/>
            </fileset>
        </jar>
    </target>

    <target name="dist" depends="jar"/>

    <target name="clean" depends="init">
        <delete dir="${ASC.build}"/>
        <delete dir="${ASC.dist}"/>
    </target>
</project>