Datasheet

Luchner c01.tex V3 - 03/20/2008 2:29pm Page 17
Chapter 1: The Development Environment
Apache ANT (from here on referred to as ANT) is a Java tool that uses XML markup to describe tasks and
dependencies in automating the software build process. If you currently do not have ANT installed on
your computer, then you will need to install it. Download the latest distribution from
http://ant.apache
.org/bindownload.cgi
.
Install ANT in a directory that makes sense with your workflow — for example,
C:/ant-
on Windows.
You will also need to add a path to your ANT installation within the Environment Variables.
If you work on a Mac, then you may already have ANT installed. Open a Terminal and type > ant
-version. If you are presented with a ‘‘command not found’’ message, then either you don’t have ANT
installed on your machine or you don’t have a path to the installation
/bin
directory set. If this is the
case, then install ANT in the
/usr/local
directory and perform the following steps.
To add a path to your ANT installation on Windows, follow these steps:
1. Click Start Control Panel System.
2. Select the Advanced tab from the menu.
3. Click on Environment Variables.
4. Within the System variables grid, navigate to and double-click on Path.
5. In the Variable Value field, add a semicolon (;) and then the path to the
/bin
folder within
your ANT installation directory. For the purposes of this example, that is
;C:
\
ant
\
bin
.
Follow these steps to add a path to your ANT installation on Mac:
1. Open the terminal and type open -e .profile.
2. Add a colon (:) and the path to the
/bin
folder within your ANT installation directory. For
the purposes of this example, that is
/usr/local/ant/bin
.
Running ANT from the command line requires a build file within the directory in which it is called.
The ANT build file is an XML markup describing tasks and dependencies for the build process. Prop-
erty values can also be set in the build file, enabling you to refer to the value of a property using the
${propertyname}
construct within tasks. A property file can also be set in the build file to separate out
the property-value pairs from the build markup.
First create the build file as it relates to the Hello World application you built previously in this chapter:
1. Enter the following markup in any text editor:
<?xml version="1.0" encoding="utf-8"?>
<!-- ======================================================================== -->
<!-- AIR Application Build File (Ant) -->
<!-- ======================================================================== -->
<project name="AIR Application" default="main" basedir=".">
<property name="app.name" value="HelloWorld" />
<property name="desc.name" value="HelloWorld-app" />
17