Building Adobe Flex project with ANT on Windows

Have you ever?
Steps are easy. You download Apache Ant from the official web site. Unzip it, then set up system variables. On Windows they will be (and make sure you have Java JDK, not just JRE installed):

1. ANT_HOME=C:\Ant
2. JAVA_HOME=C:\JDK
3. Edit your PATH system variable and add the following separated by semi-colons:
C:\JDK\bin;C:\Ant\bin;

Note that you may install JDK and And in any other locations on your workstation.
Copy, or have Flex SDK you compile your Flex app with in accessible place. Then write build.properties.override file in the root of your project. File will be similar to:

# Use this file to set the path to your Flex SDKs
#
# flex.sdk.release = the normal Flex SDK
# flex.sdk.release is required
#
flex.sdk.release=/Flex-SDKs/3.4.0
Then you have to create build.xml file at the same location. This is the file, which will be launched by Ant. Actual compiler package, mxmlc.jar, is the part of Flex SDK. Making long story short, below is the example of build xml file.For my 'libs' Flex project library it will look like this:

<?xml version="1.0" encoding="utf-8"?>
























output="${build.dir}/${ant.project.name}.swc"
include-classes="com.bluecoat.utilities.Base64 com.bluecoat.utilities.ObjUtil com.bluecoat.utilities.PrintManager com.packeteer.ps.PSData com.packeteer.ps.PacketShaper">














Also I found this build.cmd is useful as well:

if "%ANT_HOME%" == "" set ANT_HOME=c:\ant
"%ANT_HOME%\bin\ant" -buildfile build.xml %1 %2 %3 %4 %5 %6 %7 %8 %9

Now all you have to do in order to build your project is to run 'build' command in Windows command line.
For more information you can read Using Apache Ant with the SDK tools.

Comments

Popular posts from this blog

Conceptual design

How do I use InVision

Using Trello and Confluence to manage UX design project. Part 1