ant-Study Record One

Source: Internet
Author: User

<?xml version= "1.0"? ><project name= "HelloWorld" ><target name= "SayHelloWorld" ><echo message= " Hello,xutianhao "/></target></project><!--Ant_helloworld--

  

<?xml version= "1.0"? ><project name= "Projectstudy" default= "Saybasedir" basedir= "E:\apache-ant-1.8.2-bin\ apache-ant-1.8.2 "><!--default represents an action that is to be performed  target--><!--basedir The property set for the user if it is removed and then executed, the result is e: The parent directory of the ant build file--><target name= "saybasedir" ><!--command line executes the statement  Ant Saybasedir is the Saybasedir step--><!- -If you do not specify target direct ant will complete the default specified Target--><echo message= "the base dir is:${basedir}"/></target>< !--If you have two name of the same target in a project, run the result as build failede:\build.xml:20:duplicate target ' Saybasedir '--></project >

  

<?xml version= "1.0"? ><project name= "Targetstudy" ><target name= "Targeta" if= "Ant.java.version" > <!--if the If attribute exists, the target will be executed--><echo message= "Java.version:${ant.java.version}"/></target>< Target Name= "Targetb" unless= "Amigo" depends= "Targeta" ><!--if the unless attribute exists, the target will not be executed--><!-- TARGETB relies on Targeta--><!--run ant Targetb First perform targeta (dependent) and then execute TARGETB--><description>a depend example! </description><echo message= "The base dir is:${basedir}"/></target></project><!--run result E : \>ant Targetbbuildfile:e:\build.xmltargeta:     [echo] Java.version:1.7targetb:     [echo] the base dir is:e: BUILD successfultotal time:0 seconds--

  

<?xml version= "1.0"? ><project name= "Targetstudy" ><target name= "Targeta" ><echo message= "the Base dir is:${basedir} "/><!--the absolute path to the project base directory--><echo message=" the Ant.file Is:${ant.file} "/><!-- BuildFile absolute path--><echo message= "The Ant.java.version is:${ant.java.version}"/><!--ant detected Java version  - -><echo message= "The Ant.version is:${ant.version}"/><!--ant version--><echo message= "the Ant.project.name is:${ant.project.name} "/><!--the name of the project currently being developed--></target></project><! --E:\>ant Targetabuildfile:e:\build.xmltargeta:     [echo] the base dir is:e:     [echo] the base dir is:e:\build.xm L     [echo] the base dir is:1.7     [echo] the base dir is:apache Ant (TM) version 1.8.2 compiled on December     [Echo] The base dir is:targetstudybuild successfultotal time:0 seconds--

  

<?xml version= "1.0"? ><project name= "Targetstudy" ><property name= "name" value= "Xutianhao"/>< Property Name= "Age"  value= "/><target name=" Targeta "><echo message=" the base dir is:${name} "/> <!--Set the Name property Xutianhao--><echo message= "The base dir is:${age}"/>< set the Age attribute 23--></target> </project>

  

ant-Study Record One

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.