Puppetmaster3's Blog

I write code.

Team and integration: Actionscript ANT Example

Posted by puppetmaster3 on July 25, 2010

Here is a simple build.xml for getting started w/ CI (Continuous Integration). On mac and linux, ant is built into the os. In Windows, first you need to install ant by downloading it, and setting it into path plus setting the ANT_HOME env, as per Ant instructions. Here is
build.properites:


#KISS
#SDKLocation:
P_FLEX_HOME=/Volumes/Data/flex_sdk_4.1.0.16076

and simple ant:

<?xml version="1.0" encoding="utf-8"?>
<project basedir="." default="comp">

<property file=”build.properties”
description=” per developer custom props” />
<!– where is the updated sdk ( http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK )downloaded to –>
<property name=”FLEX_HOME” value=”${P_FLEX_HOME}”/>

<!– do not change next 2 lines, it adds flex tasks to ant –>
<property name=”FLEXTASKS” value=”${FLEX_HOME}/ant/lib/flexTasks.jar”/>
<taskdef resource=”flexTasks.tasks” classpath=”${FLEXTASKS}”/>

<!– typical steps/targets are:
clean output area, p4 check out, build debug, obfuscate, unit test, if test ok: build release 10.0, build 10.1, build mobile/embeded, gen asdoc,
report coverage, tag, ftp, start browser to ftped location via http url
http://www.adobe.com/devnet/flex/articles/flex_ant_pt1_print.html
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf678b2-8000.html
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7a92.html
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7ac3.html
http://www.flex2ant.org/docs.html

http://custardbelly.com/blog/?p=77

TODO: Omit trace statments
TODO: compiler.external-library-path – omit from linking

–>

<tstamp>
<format property=”timestamp” pattern=”yyyyMMdd” />
</tstamp>

<!– KISS –>

<target name=”clean”>
<delete file=”release/Demo.swf” />
</target>

<!– comp –>
<target name=”comp” depends=”clean”>
<echo message=”building …” />
<mxmlc
file=”src/Demo.mxml”
output=”release/Demo.swf”
debug=”true”
incremental=”true”
strict=”true”
use-network=”true”
keep-generated-actionscript=”true”
verbose-stacktraces=”true”
accessible=”false”
>

<theme dir=”${FLEX_HOME}/frameworks/themes/Halo/”>
<filename name=”halo.swc” />
</theme>

<!– what ever you want to say in metadata–>
<raw-metadata>version v 10 by vc</raw-metadata>

<optimize>true</optimize>
<target-player>10.0.01</target-player>
<source-path path-element=”src/”/>
<!– add swcs –>
<library-path dir=”libs” append=”true”>
<include name=”*.swc”/>
</library-path>
<default-size width=”1280″ height=”720″ />
<default-frame-rate>24</default-frame-rate>
<default-background-color>0x000000</default-background-color>
</mxmlc>
</target>
</project>


You can optionally load config. That’s it.

Advertisements

Posted in Uncategorized | Leave a Comment »