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

The Basics

Ant uses an XML syntax for its build files. A typical Ant file looks like this:

<project name="MyProject" default="compile" basedir=".">
    <target name="init">
        <tstamp/>
        <mkdir dir="build"/>
    </target>
    <target name="compile" depends="init" description="compile the source" >
        <javac srcdir="src" destdir="build"/>
    </target>
</project>

Even if you have no prior experience with Ant, it is very easy to read and understand.

Note

A build file is an XML file, usually called build.xml, with a collection of functions and variables (or targets and properties, as Ant calls them).

If we go through the preceding example, we see one project definition. (An Ant file can contain only one.) Its default is set to “compile,” meaning that when you run this file, the first function or target that runs is the compile target. The name of a target can be anything, as long as it is a string of text and numbers. So using “1 - My very cool function” is perfectly legal. (I prefer a long, descriptive target name, because it makes it easier to read in Eclipse’s Ant panel. But, if you prefer, you can also add a description property in the target to describe what that target does. The downside here is that when you let that target depend on another target, you have to type out its full name. But I’ll cover this topic more later.) The compile target has a depends property, which is set to “init.” This, in turn, runs the init target before it runs the compile target. It also creates a timestamp and a directory ...

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