ASDocAntTask project for Eclipse

A very important, yet somewhat overlooked area of design is documentation. For every public API published the quality of the code and it’s resulting usage is dramatically affected by the accompanying documentation.

In ActionScript 3.0 the ASDoc tool is invaluable. Not only is it fully supported, it is the standard for all ActionScript and mxml code documentation. Unfortunately, it is somewhat tedious to manually compile the documentation from the command line for each API you develop. To help assist developers in generating ASDocs from their code I have created a very simple ANT task which can easily be integrated within a Flex project to automate ASDoc generation.

The ASDocAntTask can be utilized from within Eclipse just as one would typically use a standard build file. Simply create an Eclipse project from the extracted file and specify the location of the source code you would like to compile documentation for as well as the directory where the generated ASDocs are to reside.

The ASDocAntTask project is comprised of the following files: asdoc.xml and asdoc.properties. Developers can specify project specific settings in asdoc.properties and run the default main target from asdoc.xml to both create the output directory, generate documentation from the source code as well as create a log file for the generated ASDocs.

The asdoc.properties file contains the following properties:

  • asdoc.exe (location of asdoc.exe)
  • src (location of source code)
  • main.title (Documentation title)
  • window.title (HTML window title)
  • output.dir (Documentation output location)

The asdoc.xml contains file contains the following targets:

  • clean (creates the output directory)
  • create-docs (generates the ASDocs)
  • log (creates the log.txt file)

These tasks can easily be modified to match your specific environment. They are very easy to use so if you do not regularly document your work then hopefully this will help get you in the habit.

You can download the ASDocAntTask eclipse project here

{ 2 comments to read ... please submit one more! }

  1. Hi,

    The ASDoc shell script that comes with the Flex 2 SDK doesn’t run well on a Mac with spaces in the path to your source folder. To get around this I wrote an ANT task which invokes the asdocs JAR directly, here is an extract that you may find useful:

    Building docs for ${src.dir} to ${asdocs.dir}

    Obviously you will need to set the relevant properties before running the target…

    Hope that helps,

    Kelvin 🙂

  2. I tried the script and executed it .It worked for me . thanks for the such a good script.

{ 0 Pingbacks/Trackbacks }