The following is the example of the ANT scripts which can be created to build the files. The below script will prints the "My first Build Script" on the command prompt.


<?xml version="1.0"?>
<project
name="Ant Tutorial" basedir=".." default="setup">


    <target name="setup">
        <echo>
My first Build Script
</echo>
    </target>
</project>


 


Running the Program


The following are the steps for running the script file.



  • Open the command prompt in the dos.

  • Go to the directory where you place the file.

  • Type ant build1.xml file.


Output


 


The following is the output printed on the command prompt when you run build1.xml file.


 


Buildfile: build1.xml


setup:
     [echo] My first Build Script


BUILD SUCCESSFUL
Total time: 0 seconds

                    

Copyright © 2010 VisualBuilder. All rights reserved