Tuesday, July 15, 2008

Creating ASDoc for your Flex application

Since we're heading down the path of creating an actual product in Flex here I decided to look into ASDoc. Once I found the location of the asdoc.exe the whole experience was fairly painless. Above each of my classes and functions I've added a comment something like this:
/**
* Starts this class.
* Try to start this class.
*
* @throws MyError upon error of if the class was in an invalid state for this operation.
*/
function start():void


And then from a command prompt I typed:

C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\bin>asdoc -doc-sources "C:\MyProject\src" -main-title "My OSGi Framework" -window-title "My Documentation" -output OSGI_ASDoc


after hitting enter I got this status message:
Loading configuration file C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\fram
eworks\flex-config.xml


followed by a 'complete' message. The resulting html document looks much as you'd expect a Javadoc to look, with links to each class and package along with your comments. I'd suggest this to anyone trying to keep up with a fairly complex object model, especially if you will be having more than one person working on it.

No comments: