2010-06-15 115 views
0

任何人都可以幫助我知道這些標記在build.xml文件中的作用嗎?build.xml in ant

1)<property file="" location="."/> 
2)<property environment=""/> 
3)<property name="" value=""/> 
4)<path> id="classpath.base" 
5)<pathelement> location="$some.jar"/> 
6)<path> id="classpath.build"> 
7)<path> id="classpath.test"> 
8)<target></target> 

謝謝

回答

0

<property environment=""/>是系統環境變量
<property name="" value=""/>與值

location屬性指定單個文件或相對目錄到項目的基本目錄(或絕對文件名)定義變量,而path屬性接受冒號或以分號分隔的位置列表。 path屬性旨在與預定義路徑一起使用 - 在任何其他情況下,應優先考慮具有location屬性的多個元素。

Targets包含任務元素。構建文件的每個任務元件可以具有id屬性,並且可以通過稍後提供給此

<project name="MyProject" default="dist" basedir="."> 
    <description> 
     simple example build file 
    </description> 
    <!-- set global properties for this build --> 
    <property name="src" location="src"/> 
    <property name="build" location="build"/> 
    <property name="dist" location="dist"/> 

    <target name="init"> 
    <!-- Create the time stamp --> 
    <tstamp/> 
    <!-- Create the build directory structure used by compile --> 
    <mkdir dir="${build}"/> 
    </target> 

    <target name="compile" depends="init" 
     description="compile the source " > 
    <!-- Compile the java code from ${src} into ${build} --> 
    <javac srcdir="${src}" destdir="${build}"/> 
    </target> 

    <target name="dist" depends="compile" 
     description="generate the distribution" > 
    <!-- Create the distribution directory --> 
    <mkdir dir="${dist}/lib"/> 

    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --> 
    <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/> 
    </target> 

    <target name="clean" 
     description="clean up" > 
    <!-- Delete the ${build} and ${dist} directory trees --> 
    <delete dir="${build}"/> 
    <delete dir="${dist}"/> 
    </target> 
</project> 
的值被稱作