You want to generate your ASDoc documentation using ant.
Install ant in flex builder and use tasks to generate documentation.
When deploying flex application we can use very powerful tool – ant. With his help we can launch applications, run command line tools, copy files and much, much more (see: ant.apache.org/manual/index.html)
Before we start you should install ANT on your flex builder if you have stand alone version.
See article “Installing Ant in Flex Builder 3” at : blog.jodybrewster.net/2008/04/09/installing-ant-in-flex-builder-3/
After that, just create two files in project:
build.properties:
############# Flex Properties ####################################
# change this path to your flex sdk directory
# Use "/" in your directory path e.g. C:/FlexSDK/3.0.0
FLEX_HOME=C:/flex_sdk_4.0
################## Project Properties ############################
src-dir =${basedir}/src
lib-dir =${basedir}/libs
doc-dir =${basedir}/doc
doc-title ="ASDoc Sample Hello"
asdoc.exe =${FLEX_HOME}/bin/asdoc.exe
build.xml:
<project name="Ant build ASDoc sample" basedir="." default="build doc">
<!-- load user configuration properties -->
<property file="build.properties" />
<!-- =============
target: build doc
================ -->
<target name="build doc">
<exec executable="${asdoc.exe}">
<arg line='-doc-sources "${src-dir}"' />
<arg line='-main-title ${doc-title}' />
<arg line='-window-title ${doc-title}' />
<arg line='-output "${doc-dir}"' />
<arg line='-package tom.hallo "Sample hello world package"' />
<arg line='-package tom.windows "All windows"' />
</exec>
</target>
</project>
First file build.properties, holds info about location FlexSDK and files structure in your project.
Code in build.xml loads build.properties and run ASDoc tool.
From now generating documentation is very simple.
In Flex Builder, just drag and drop build.xml from Flex Navigator to Ant view and double “click build doc” task.