


This is target “Clean” which will delete old build before building new one, you can have as many target you want based on your need.ĭelete task or tag is used to delete directory, file etc, verbose=true makes it to print message while deleting in cosole, is an important tag and I recommend you to read in detail somewhere in ant manual or may be I will explain in detail sometime because it include “patternset” which supports pattern matching of directory/files via its includes and excludes attribute which is extremely useful to filter unwanted files (generally meta data files form CVS, SVN etc). This will print message in console as “doing all”

“depends ontarget” says that before executing this target executed first “clean” and then “compile” ”name” attribute specified name of target. Here we are defining a target since we have already called target “all” as default in project tag, so if we don’t specify this target our build will fail to say “target not found”. I recommend that you always use property in your build.xml instead of using hard coded values in target for directory name etc, this will give you flexibility to change the value anytime without changing at many places (in case you have hard coded it). location to specify location of any properties file. denotes ant’s property task, which do have some other attribute e.g. Here we are declaring and specifying property ,you can say variable every property has at least two attributes “name” and “value”, though you can define your all properties in a separate properties file and load from there as well. The project name is “test” defined by attribute “name” default target is “all” while running “ant” command from command prompt if we don’t specify any target than ant executed this default target.īasedir tells which is the top level directory for creating the build in this case its current directory (from where you run ant command), denoted by dot “.”. This line defines our project every build file must have this line. project ,target ,property and task and the order in which different target gets executed to start with basic build procedure. Here is a sample build.xml you just need to know important element e.g.
