AsDoc with Eclipse

If you don’t like to use Ant for generating your ActionScript docs you can create an External Tools Configuration in Eclipse (or Flex Builder).

overview

External Tools Dialog

step-by-step

1. Open External Tool Dialog

2. Create new configuration for “Run a program”

3. Location
Click “Browse File System” to insert the location of your AsDoc tool. It’s included in the Flex SDK “flex_sdk_3/bin/asdoc” (or “flex_sdk_3/bin/asdoc.exe” for Windows).

4. Working Directory
This is your projects root directory. Click “Browse Workspace” if your project is available in Eclipse (or Flex) or “Browse File System” to locate your project somewhere on your harddrive.

5. Arguments
You have to insert all the needed AsDoc comands here, e.g. ‘ -doc-sources ./src -output ./doc -main-title “Test API” -window-title “Test API” ‘. You can find more about the AsDoc commands in the Flex docs

6. Run
You’re done. Whenever you launch this configuration it generates the docs in the specified folder.



9 Responses (Add Your Comment)

  1. Description is spot on and worked like a charm!
    Thank you

  2. great description. works great.

  3. Hi – My project has references to several movieClips set to export as classes in a swc file. When I try to build documentation using AsDoc I get several errors saying “Type was not found or was not a compile-time constant” or “Call to a possibly undefined method” for all the movieClip instances. The project compiles fine without any errors though.

    Any suggestions on how to fix this AsDoc problem?

  4. I guess you have to add your swc file to the -doc-sources or -library-path

    check out the docs for a complete list of arguments http://livedocs.adobe.com/flex/201/html/asdoc_127_9.html#142061

  5. I haven’t tried it yet, but could this work? This way you could re-use the same tool on different projects, depending on which project you have currently selected.


    -doc-sources ./src -output ./doc -main-title “${project_name} Documentation” -window-title “${project_name} Documentation”

  6. hey dan, the idea is actually quite nice. here you go:

    Working Directory
    ${project_loc}

    Arguments:
    -doc-sources ./src -output ./doc -main-title “${project_name}” -window-title “${project_name}”

    Now the docs of the selected project are getting built.

  7. Hello Martin,

    This is a very helpful post. I don’t know how to use asdoc at the moment, so I ran into trouble when documenting my current project.

    I am using Flash Player 10 classes and did set the external-library-path so that’s fine. I am using MinimalComps(dependency) in my project so I’ve set -exclude-dependencies, but this causes an Error. It seems I cannot use both -ds/-doc-sources and -exclude-dependencies:

    “Error: exclude-dependencies can not be used with doc-sources.”

    My arguments look like this: -output ./doc -source-path ./src -library-path ./lib -main-title “${project_name}” -window-title “${project_name}” -external-library-path “/Applications/FDT/plugins/com.powerflasher.fdt.shippedFlexSDK4_4.0.0.14159_1000/flex/frameworks/libs/player/10.0/playerglobal.swc” -exclude-dependencies -ds ./src

    How can I generate the documentation ?

    I’ve also tried using -doc-classes and adding the full class names, but I get another error:

    oading configuration file /Applications/FDT/plugins/com.powerflasher.fdt.shippedFlexSDK4_4.0.0.14159_1000/flex/frameworks/flex-config.xml
    _654c83ca96a62fe72776d64d86c4163b9683d1818934514561acf824b0fbf8e5_mx_core_FlexModuleFactory.as(26): col: 16 Error: Interface IFlexModuleFactory was not found.

    implements IFlexModuleFactory, ISWFContext
    ^

    _654c83ca96a62fe72776d64d86c4163b9683d1818934514561acf824b0fbf8e5_mx_core_FlexModuleFactory.as(26): col: 36 Error: Interface ISWFContext was not found.

    implements IFlexModuleFactory, ISWFContext
    ^

    Any hints ?

  8. Hey George,

    Try to use external-library-path …
    -external-library-path=/Path/To/lib.swc

    cheers Martin

Trackbacks:

Leave a Reply

Formatting: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Other Entries

About

Martin Rädlinger is an Interactive Developer & Designer. He specializes in interactive coding predominantly with ActionScript, but every new challenge is welcome. If you like his work feel free to get in touch with him. At the moment he's available for freelance work.

Contact

Martin Rädlinger
mail: mr [at] formatlos.de
web: www.formatlos.de
xing: Martin Rädlinger
linkedin: Martin Rädlinger
skype: martinraedlinger