I am learning to build automatic Java compiling script using Ant. With respect to the following code segment, what does the default=”dist” stand for? For the basedir=”.”, does “.” mean the working directory, which has build.xml stored?
<project name="Myproject" default="dist" basedir=".">
With respect to the following segment, what does location=”src”/ stand for?
<property name = "src" location="src"/>
The
defaultattribute indicates the target which will be executed if you are callingantwithout any target argument. Thus with this setting,antwill be synonymous toant dist.The
basedirattribute is interpreted relatively to the parent directory ofbuild.xml, yes. (This directory is usually the same as the current working directory, but does not have to be.)The
locationattribute of the property task converts a path relative to the projectsbasedirto an absolute path. Thus, in your case you will get the absolute path ofsrcin the buildfile’s directory. (It will also do conversion of/and\to your platform’s conventions.)