<?xml version="1.0" encoding="UTF-8"?>

<!-- Build for netx: compile, jar, javadoc, clean -->
<project basedir="." default="all" name="netx">

    <!-- all -->
    <target name="all" depends="init,compile,jar">
        <echo message="Application built!"/>
    </target>

    <!-- init -->
    <target name="init">
        <property name="classes" value="classes"/>
        <property name="src" value="src"/>
    </target>

    <!-- compile -->
    <target name="compile" depends="init">
        <mkdir dir="${classes}"/>
        <javac destdir="${classes}" srcdir="${src}" optimize="false" debug="true" deprecation="false"/>
        <copy todir="${classes}">
            <fileset dir="${src}">
               <include name="**/resources/*"/>
               <include name="**/*.gif"/>
               <include name="**/*.png"/>
               <include name="**/*.jpg"/>
               <include name="**/*.jnlp"/>   
               <include name="**/*.class"/>
            </fileset>
        </copy>
    </target>

    <!-- jar -->
    <target name="jar" depends="init,compile">
        <copy file="src/netx/jnlp/resources/default.jnlp" todir="${classes}/"/>
        <jar basedir="${classes}" compress="true" jarfile="netx.jar" manifest="${src}/netx/jnlp/resources/Manifest.mf">
            <exclude name="**/*.java"/>
            <exclude name="**/.xvpics"/>
            <exclude name="netx/**/default.jnlp"/>
            <exclude name="netx/**/Manifest.mf"/>
            <include name="default.jnlp"/>
            <include name="nanoxml/**"/>
            <include name="javax/**"/>
            <include name="netx/jnlp/**"/>
        </jar>
    </target>

    <!-- javadoc -->
    <target name="javadoc" depends="init,compile">
        <delete dir="javadoc"/>
        <mkdir dir="javadoc"/>
        <javadoc destdir="javadoc" packagenames="netx.jnlp.*" access="package"
        Doctitle="Netx v0.5 JavaDoc" Windowtitle="Netx v0.5 JavaDoc"
        Header="&lt;a target=&quot;_top&quot; href=&quot;http://jnlp.sourceforge.net/netx/&quot;&gt;Homepage&lt;/a&gt;">
            <sourcepath>
                <pathelement location="${src}"/>
            </sourcepath>
        </javadoc>
    </target>

    <!-- clean -->
    <target name="clean" depends="init">
        <delete>
            <fileset dir="${classes}">
                <include name="**/*"/>
            </fileset>
        </delete>
        <delete>
            <fileset dir="${src}">
                <include name="**/*.java~"/>
            </fileset>
        </delete>
    </target>

</project>


