Using Asdoc under OSX

At work I’m without my install of Flex, and its various niceities like ant builds for creating ASDoc documentation for my various classes and work projects.

In the past I’ve messed around with the commandline controls for creating ASDoc documentation, but without a great deal of success.

However, at work today, I decided to get it working and create some documentation. There are a range of options for creating asdoc documents on the mac, I’ll list them below.

1 / Command line. Downloading the Flex SDK and kicking it command line style.

2 / Getting a copy of Flex, and using Ant to build your docs.

3 / Using either the SDK, or Flex but a front end tool like Dita to generate the shell scripts for you, that you then run in terminal to create your docs.

I’ve used Dita and Flex with an Ant build on my home mac. At work, I use the command line approach.

Heres how I got it to work, using the new Flex 4 SDK beta and the OSX terminal.

a / Make sure you have downloaded the latest Flex SDK. Unzip it and place it somewhere on your hard drive. Mine lives in the “Developer” folder of my OSX boot disk.
b / Open up a text editor. I always find it easier to work out my terminal commands in a text editor, and simply paste in what I want into termainl when I’m ready.
c / Find the path to your bin folder within your Flex SDK folder. The simplest way, is to simply drag n drop the bin folder into an empty terminal window, which will then give you the path to the folder. Or simply, type it out manually. You now need to tell terminal to work from this ‘bin’ directory, via the ‘cd’ command. The syntax for that is below;

cd path-to-you-flex-sdk-bin-folder

d / Now you can simply run the various asDoc commands to generate your documentation. The various commands I’ve used to create the documentation for my NpFSObjectresize class are listed below. Make sure the asdoc commands are all on one long line. For some reason, I had to have the footer and window title before the -doc-sources parameter.

cd /Developer/SDKs/flex_sdk_4.0.0.7219/bin/
./asdoc -main-title="NpFSOBjectResize Class" -window-title="Noponies NpFSOBjectResize Class" -footer="Copyright <a href='http://www.blog.noponies.com' title='Visit Class Author'>Noponies</a> 2009" -doc-sources=/Users/dsattler/Desktop/sample/noponies -output=/Users/dsattler/Desktop/sample/docs

As you can see from the example above, I have a folder called ’sample’ on my desktop with my actionscript residing in a folder called ‘noponies’. I’m simply outputting my docs to a folder called ‘docs’ which resides within that ’sample’ folder.

When you are ready, simply paste in your ASDoc commands into terminal, and you should see the asdoc tool run through its various steps. One thing I’ve noticed is that the Flex 4 ASDoc tool is much more strict about correctly closing html tags etc within your documentation. A missing closing /p caught me out.

One Neigh about “Using Asdoc under OSX”



Burn Neighed:

Very Usefull, 10x again Dale :)

Leave a neigh?