Ant任务-build.xml

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

<project name="IPTVMW" default="jar" basedir=".">

    <!-- Set global properties for this build. -->
    <property file="../../build.properties" />
    <property name="target" value="./target" />
    <property name="dist" value="../../build/IPTVMW/APP/ACS" />
    <property name="src" value="./src" />
    <property name="web" value="." />
	<property name="jarfile" value="ACS.jar" />


    <!-- classpath -->
    <path id="class.path">
        <fileset dir="../../build/lib-ext">
            <include name="**/*.jar" />
        </fileset>
        <fileset dir="../../build/IPTVMW/APP">
            <include name="**/*.jar" />
        </fileset>
    </path>


    <!-- build ACS -->
    <target name="clean">
        <delete dir="${target}" />
    </target>

    <target name="init">
    	<mkdir dir="${target}/WEB-INF/lib" />
        <mkdir dir="${target}/WEB-INF/classes" />
        <mkdir dir="${dist}" />
    </target>

    <target name="static" depends="init">
        <copy todir="${target}">
            <fileset dir="${web}">
            	<exclude name="src/**" />
            	<exclude name="target/**" />
            	<exclude name="**/*.jar" />
                <exclude name="**/*.scc" />
            	<exclude name="**/build.xml" />
            </fileset>
        </copy>
    </target>

    <target name="compile" depends="static">
        <javac source="${javac.source}"
               srcdir="${src}"
               destdir="${target}/WEB-INF/classes"
               debug="on"
               deprecation="true">
            <classpath refid="class.path" />
        </javac>
    </target>

    <target name="jar" depends="clean, compile">
        <delete dir="${dist}/${jarfile}" />
        <jar jarfile="${dist}/${jarfile}" basedir="${target}" 
manifest="META-INF/MANIFEST.MF"/>
        <delete dir="${target}" />
    </target>

</project>

你可能感兴趣的:(xml,ant)