• What is Ant?
• Why use Ant?
• How can we use Ant?
• How to stream development with Ant?
What Is Ant?
• Ant is a Java-based build tool. In theory, it is kind
of like make, without make's wrinkles.
• Ant is different. Instead of a model where it is
extended with shell-based commands, Ant is
extended using Java classes. Instead of writing
shell commands, the configuration files are XML-
based, calling out a target tree where various
tasks get executed. Each task is run by an object
that implements a particular Task interface.
So If Ant is Java why do we want to use
it for PHP
• Well Ideally Ant was used to stream line build
and compilation with Java in response to
• With the way Ant is, it can be used in any
automation we want as long as all the
requirements used in the automation are
– We can’t use something we don’t have ;-)
• Ant can be downloaded from:
• Most Current IDE come with Ant Pre-installed
– My Personal Preference NETBEANS IDE
– Other’s like Eclipse …. (WHY????)
• MAC OS ant is pre-installed, UBUNTU also, but
always update ;-) …
Ant Task… huh?
• Ant has a ton of task both built in and
• Ant Task are “actions” to be done in the Ant
The Ant Build File
<!-- this is an ant script to build the project and
<project name=”Demo" default="freshBuild"
This is the ant script to build demo this has the
ability to clean the build, create a Code Report,
Run Unit Tests and Build Documentation
UMMM…. Ok but how does it work…
• So you see how the ant xml file looks, you know
the buckets that are included with Ant and you
have an idea of how you want your build to go ….
SO how do you use it?
• Simple… in your Terminal / command prompt /
console navigate to the build file ohh wait I didn’t
tell you where the build file should go huh…. Well
I always place it at the root of the site so all my
paths are relative to that root.
But really now how to build it….
• Once you have navigated to the desired location
all that is left to do is run the command as follows
ant <target name>
Yep that’s all … so each target is an “task” you can
do. But recall the freshBuild target .. That had
depends as an attribute. Well those depends are
all ran when you execute “ant freshBuild”
Basic errors most commonly found
• Ant depends orders – if some targets need
something to happen first that should happen
before that task is executed
• You are using a ant task that isn’t installed
• You action is producing an error and causes
the execution to terminate
• You run out of memory :-D rare but possible
on many large scale projects.
• Thanks go to ROKKAN for providing us with
the Conference space.
• My Email: firstname.lastname@example.org
• AIM: albertrosa2000
• Meetup: www.meetup.com/codeigniter/
• Rokkan: www.rokkan.com