Skip to Main Content
Automating ActionScript Projects with Eclipse and Ant
book

Automating ActionScript Projects with Eclipse and Ant

by Sidney de Koning
October 2011
Intermediate to advanced content levelIntermediate to advanced
98 pages
2h 18m
English
O'Reilly Media, Inc.
Content preview from Automating ActionScript Projects with Eclipse and Ant

Our First “Real” Ant Script

Next, we will use our new template to create our first real Ant script.

To get you started, I will explain some of the fundamentals of the Ant language. These are the basic functions you need to learn for now; along the way, we will explore more, so don’t worry when we don’t cover them all at once.

Projects

Every Ant XML file starts off with an XML declaration (for good practice) and a project begin node and end node. The project node is kind of like a target, except that there can be only one. For it to function properly, it needs to have a name property. The basedir property defines the directory Ant should start from—for example, when it needs to traverse directories. The following is an example of a project node:

<?xml version="1.0" encoding="UTF-8"?>
    <project name="Default Project" basedir=".">
        ...
    </project>

Note

If you need to go one directory level higher, you can use either ../../ or .; just make sure you also place your Ant build file in the root of your Eclipse project.

Functions

As mentioned previously, Ant calls functions targets. A target consists of a target node with a name element. This element is mandatory, meaning it must always be in a target. The name element is basically the name of your target, and it enables you to call that target via the command line from a build file. You can also add a description property to describe what the target does, as shown here:

 <target name="create-timestamp" description="Creates a Timestamp"> ... </target> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

AdvancED ActionScript 3.0: Design Patterns

AdvancED ActionScript 3.0: Design Patterns

Ben Smith
ActionScript 3.0 Cookbook

ActionScript 3.0 Cookbook

Joey Lott, Darron Schall, Keith Peters
Migrating to Swift from Flash and ActionScript

Migrating to Swift from Flash and ActionScript

Radoslava Leseva Adams, Hristo Lesev

Publisher Resources

ISBN: 9781449314736Errata PageSupplemental Content