AsDoc with FDT
June 5th, 2008 • ActionScript, Flash
AsDoc is a very useful tool for documenting the API of your classes particularly if you work in a team. Unfortunately it is not implemented in FDT but as it is a command line tool and included in the Flex 3 SDK you can use it via an ant buildfile. The following examples are for Mac OSX users but it should work on Windows with a few changes as well.
Creating the files
Create two files ‘build_project.properties’ and ‘build.xml’ and put it in your project root folder.
build_project.properties
In this file you can make all your project and platform specific settings.
common.flex3dir = /Applications/eclipseBase/flex_sdk_3/
common.flex3bindir = ${common.flex3dir}/bin
common.asdoc = ${common.flex3bindir}/asdoc
project.src = ${basedir}/src
project.doc = ${basedir}/docbuild.xml
Ant uses ‘build.xml’ files to automate your build
< ?xml version="1.0"?> <project name="testAsDoc" default="asdoc"> <!-- import the settings --> <property file="${basedir}/build_project.properties"/> <target name="asdoc"> <!-- delete all files in the doc dir --> <delete includeemptydirs="true"> <fileset dir="${project.doc}" includes="**/*" /> </delete> <!-- create docs --> <exec executable="${common.asdoc}"> <arg line=" -doc-sources '${project.src}' -output '${project.doc}' -main-title 'Test API' -window-title 'Test API'" /> </exec> </target> </project>
run AsDoc
Drag&Drop the ‘build.xml’ to the Ant window and doubleclick on it to start AsDoc.

postcompile AsDoc
Alternatively you can specify your ‘build.xml’ to postcompile after every build process in your ‘Run Dialog’
8 Responses (Add Your Comment)
-
-
Szabesz March 26, 2009at 2:18 pm
above is not well formatted after copy-paste. Fix it, and everything will be ok.
-
John Barrett September 1, 2009at 4:54 am
Does this work for using Properties>Ant>New Task?
-
John Barrett September 1, 2009at 5:36 am
I got it working`-` My set up is a little different so I changed some settings. By the way where is the Flex 3sdk on FDT using the standalone? I looked in plugins but could not find it.
This is great, and I am so happy to have this working. I would love to set this up as a general property that is set up when I create a new flash project in FDT.
Thanks,
Johnny -
Thron247 September 28, 2009at 3:34 pm
Nice!! Thanks!
-
Philip October 2, 2009at 9:47 am
Works like a charm (after fixing the markup).
I had to google how to specify external libraries, but that’s just my poor asdoc skills :)
nice! thx