< echo > You are NOT running this script in Solaris </ echo >
</ target >
</ project >
Sample Build file
Save the file as test.xml in some temporary folder ( Say C:Temp)
Set ANT_HOME= C:Jakarta-Ant-1.5
Set PATH=%PATH%;%ANT_HOME%in
Cd C:Temp
ant –buildfile test.xml
Buildfile: test.xml setup: pre-hello1: pre-hello2: [echo] You are NOT running this script in Solaris hello: [echo] Hello World BUILD SUCCESSFUL Total time: 1 second
Built-in Properties
Ant provides access to all system properties and also has some additional properties.
the JVM version Ant detected; ant.java.version The name of the project that is currently executing; it is set in the name attribute of <project>. ant.project.name The version of Ant ant.version The absolute path of the buildfile. ant.file The absolute path of the project's basedir (as set with the basedir attribute of <project>). basedir
Ant – Different flows
Using “depends”
Using “antcall”
Using “ant”
Ant – Different flows
Using “depends” – Last task to first task
Eg :
<target name="compile" depends="init, setup" description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
0 comments
Post a comment