Source

nbNetCatUpdater / build.xml

Full commit
<?xml version="1.0" encoding="UTF-8"?>
<project name="nbNetCatUpdater" basedir="." default="jar">

    <property file="nbproject/nbjdk.properties"/>
    <property name="user.properties.file" location="${netbeans.user}/build.properties"/>
    <property file="${user.properties.file}"/>
    <import file="nbproject/jdk.xml"/>

    <target name="-init" depends="-jdk-init">
        <property file="user.build.properties"/>
        <property file="build.properties"/>
    </target>

    <target name="compile" depends="-init" description="Compile main sources.">
        <mkdir dir="${classes.dir}"/>
        <depend srcdir="${src.dir}" destdir="${classes.dir}" cache="build/depcache">
            <classpath path="${cp}"/>
        </depend>
        <javac srcdir="${src.dir}" destdir="${classes.dir}" source="1.5" debug="${debug}" deprecation="${deprecation}" includeantruntime="false">
            <classpath path="${cp}"/>
            <compilerarg value="-Xlint:unchecked"/>
        </javac>
        <copy todir="${classes.dir}">
            <fileset dir="${src.dir}" excludes="${jar.excludes}"/>
        </copy>
    </target>

    <target name="jar" depends="compile" description="Build JAR file for main sources.">
        <jar jarfile="${jar}" compress="true"><!-- manifest="${manifest}" -->
            <manifest>
                <attribute name="Main-Class" value="${main.class}"/>
            </manifest>
            <fileset dir="${classes.dir}"/>
        </jar>
    </target>

    <target name="run" depends="jar" description="Run application.">
        <!--<fail unless="main.class">Must set property 'main.class' (e.g. in build.properties)</fail>
        <java classname="${main.class}" fork="true" failonerror="true">
            <classpath path="${run.cp}"/>
            <jvmarg value="-ea"/>
        </java>-->
        <java jar="${jar}" fork="true"/>
    </target>

    <target name="compile-tests" depends="compile">
        <mkdir dir="${test.classes.dir}"/>
        <depend srcdir="${test.dir}" destdir="${test.classes.dir}" cache="build/test-depcache">
            <classpath path="${test.cp}"/>
        </depend>
        <javac srcdir="${test.dir}" destdir="${test.classes.dir}" source="1.5" debug="true" deprecation="${deprecation}" includeantruntime="false">
            <classpath path="${test.cp}"/>
            <compilerarg value="-Xlint:unchecked"/>
        </javac>
        <copy todir="${test.classes.dir}">
            <fileset dir="${test.dir}" excludes="${jar.excludes}"/>
        </copy>
    </target>

    <target name="run-tests" depends="compile-tests" description="Run JUnit tests.">
        <mkdir dir="${test.results.dir}"/>
        <junit failureproperty="tests.failed" showoutput="true" fork="true">
            <batchtest todir="${test.results.dir}">
                <fileset dir="${test.dir}">
                    <include name="**/*Test.java"/>
                </fileset>
            </batchtest>
            <classpath path="${test.run.cp}"/>
            <formatter type="brief" usefile="false"/>
            <formatter type="xml"/>
        </junit>
        <fail if="tests.failed">Some tests failed; see details above.</fail>
    </target>

    <target name="javadoc" depends="-init" description="Build Javadoc.">
        <mkdir dir="${javadoc.dir}"/>
        <javadoc destdir="${javadoc.dir}" source="1.5">
            <classpath path="${cp}"/>
            <sourcepath>
                <pathelement location="${src.dir}"/>
            </sourcepath>
            <fileset dir="${src.dir}"/>
        </javadoc>
    </target>

    <target name="clean" depends="-init" description="Clean build products.">
        <delete dir="${build.dir}"/>
    </target>

    <!-- Has to be here for NB profiler to find it, alas: -->
    <target name="profile">
        <ant antfile="nbproject/netbeans-targets.xml" target="profile"/>
    </target>

</project>