AntFlexLib is a project mainly written in ..., it's free.
ant - ant library for flex integration
AntFlexLib is an library for ANT dedicated for Flex application. AntFlexLib is presented as xml, the language use for ANT build files.
This library handles: _ asdoc generation
It is build as a real library using macrodef feature which will made AntFlexLib easy to use into a continuous integration process or simply for a application that use source versionning control.
The only constraint for AntFlexLib is a specific project organization. However this one correspond to those generaly used (it is compatible with Flash Builder projects). This one is the following:
/MyApplication
/build/
/config/
/src/
/bin/
/docs/
/tests/
You can handle sub components or several top applications using the same build:
/MyApplication
/build/
/main1/
/bin/
/config/
/docs/
/src/
/tests/
/main2/
/bin/
/config/
/docs/
/src/
/tests/
/bin/
/libs/
/lib1/
/bin/
/config/
/docs/
/src/
/tests/
build: contains the build information:
config: flex configuration files:
doc: generated asdoc.The asdoc is automaticaly ziped to prevend from polluting the workspace with a lot of files (that generaly pollutate also the version control system). can be uzipped on the integration server
src: sources of the application. Should contains at least the mxml file corresponding to the application name givent to AntFlexLib.
"functions" are macrodef.
prepare-swf ({@name}, {@path}): handle the deployment of a swf for the project {@name} into {@path}
if the tests failed, stop the process
prepare-swc ({@name}, {@path}): same as prepare-swf but for swc
dispose-bin ({@path}): delete all intermediary file generated at compilation (link-report, cache). Should be call before deploying to prevend from links issues
The following methods are utils method used by the two main methods (prepare-swf and prepare-swc)
build-info ({@path}): generate a build info file into {@path}/build.info tests ({@path}): perform unit tests of {@path} found into {@path}/tests/ (flexunit) docs ({@path}): generate the documention of {@path} into {@path}/docs/ ccompc ({@name}, {@path}): generate the swc {@path}/bin/{@name}.swc cmxmlc ({@name}, {@path}): generate the swf {@path}/bin/{@name}.swf prepare-bin ({@path}): generate sequentially docs and tests
compilation configuration
Example of AntFlexLib:
~/foobar/build/build.properties:
ANTFLEXLIB_HOME = /usr/share/antflexlib/ FLEX_HOME = /usr/share/flex/
build.mode = dev force.tests = true force.docs = false
~/foobar/build/build.xml:
<?xml version="1.0" encoding="UTF-8"?>
<property file="./build.properties" />
<import file="${ANTFLEXLIB_HOME}build/build.lib.xml" />
<target name="Foo">
<prepare-swc path="../lib/foo/" name="hello" />
</target>
<target name="Bar">
<prepare-swc path="../lib/bar/" name="word" />
</target>
<target name="FooBar" depends="DisposeAll, Hello, Word">
<prepare-swf path="../" name="helloword" />
</target>
<target name="DisposeAll">
<echo message="dispose all builds" />
<dispose-bin path="../lib/foo/" />
<dispose-bin path="../lib/bar/" />
<dispose-bin path="../" />
</target>
~/foobar/config/app.xml
<?xml version="1.0" encoding="utf-8"?>
<!--insert here all link reports no to recompile
<load-externs></load-externs>
-->
~/foobar/config/docs.xml
<?xml version="1.0" encoding="utf-8"?>
then just run: ant ~/foobar/build/build.xml