Ant Build.xml for ASDocs Generation in Eclipse

August 15th, 2006 · 11 Comments


I am an avid user of eclipse and so this evening knocked together this simple Ant build.xml file. The file allows generation of AS3 class ASDocs from within the Eclipse IDE. I am not an Ant master, far from it, so if anyone has any ideas on making this more usefull feel free to leave a comment.

I placed this in a folder in the root of my project called docs. The final docs are produced to sub folders of the docs folder called output/AppDocs. A screen shot of output can be seen here.

ASDocs_Screen

The XMl source is below the fold along with a link to the raw build.xml file

[XML]
< ?xml version="1.0"?>















[/XML]

Incase the XML above does not work the file is available here

ASDoc:Using ASDoc
ASDoc:Creating ASDoc Comments

Share and Enjoy:
  • Digg
  • del.icio.us
  • Reddit
  • StumbleUpon
  • Technorati
  • NewsVine
  • Facebook
  • Google Bookmarks
  • TwitThis
  • e-mail
  • Pownce
How about donating a coffee, beer or even a round of beers for my efforts here? Thats around £2.50 for a coffee or a pint or about £10 for a round of beers. Cheers!

Tags: ActionScript 3 · Development · Flash 9 · Flex 2

11 responses so far ↓

  • 1 Brian // Aug 15, 2006 at 11:05 pm

    Very nice, thanks for posting this!

  • 2 Pardini // Aug 21, 2006 at 3:21 pm

    This was very useful, thank you.

  • 3 Webdevotion // Dec 13, 2006 at 12:45 pm

    Thank you !

  • 4 dong // Feb 1, 2007 at 6:36 am

    it might be good but I can’t understand about that.
    how can I connect with Eclipse ?
    can you descript more detil?

  • 5 Ant and ASDoc // Feb 21, 2007 at 1:37 pm

    [...] At the hand of the Ant script made by Darron Schall and the one by Dave Williamson I put together my own. [...]

  • 6 Josh // Mar 21, 2007 at 4:53 am

    I’m trying to get this working, but I keep getting the following error:

    Exception in thread “main” java.lang.NoClassDefFoundError: Flex

    Any ideas? I’m using FB2 on OSX. I’ve got the paths in the XML changed to point to asdoc and my projects, but it’s still throwing these errors.

  • 7 Dave // Mar 21, 2007 at 8:24 pm

    I haven’t actually tried running this since I switched to a mac I have to confess. I wonder if it may be something specific to the formating of Mac File structures? I will try and find some time to look at this and see if I cant find an answer.

  • 8 Thijs // Mar 23, 2007 at 2:18 pm

    I’m getting the same “Exception in thread “main” java.lang.NoClassDefFoundError: Flex” error on Mac OSX. :(

  • 9 Shawn Makinson // May 17, 2007 at 10:32 pm

    I just spent some time dealing with this on my mac. I’m sure I will run into more things later, but for now it works and here’s how. I had to deal with spaces in the path to my flex install, so to work around that I made a simlink in / to point to the flex sdk folder.

    ln -s /Applications/Adobe\ Flex\ Builder\ 2/Flex\ SDK\ 2/ flex_sdk

    Here is the build file I ended up with. I know nothing about ant so thatnks to the others who got me started, I never expected such an ordeal. Now I can right click from flexbuilder and choose run as ant. Note that first you need to do step 2 of this:

    http://www.levelofindustry.com/display/ShowJournal?moduleId=676235&categoryId=108635

    and this:

    http://www.peterelst.com/blog/2006/09/03/flex-builder-2-ant-support/

    <?xml version="1.0"?>
    <project name="Documentation" default="asdocs">

    <!–
    Note that /flex_frameworks/ is a simlink I setup to point to the actual Flex sdk install since
    there are issues with spaces in the command line arguments.
    –>

    <property name="flex" value="/flex_sdk"/>
    <property name="templates" value="${flex}/asdoc/templates"/>
    <property name="doc-sources" value="../com"/>
    <property name="output" value="../docs"/>

    <target name="asdocs">
    <!– Clean out the contents of the doc directory, without deleting "docs" –>
    <delete includeemptydirs="true">
    <fileset dir="${output}" includes="**/*" />
    </delete>

    <exec executable='${flex}/bin/asdoc'>
    <arg value='-library-path /flex_sdk/frameworks/libs'/>
    <arg value='-library-path /flex_sdk/frameworks/locale/en_US'/>
    <arg value='-library-path /local_actionscript_library/flex-lib/1.7'/>
    <arg value='-library-path /local_actionscript_library/djangoamf/s2flex2-components/target/swc'/>
    <arg value='-library-path /local_actionscript_library/cairngorm/2.2'/>
    <arg value='-doc-sources ${doc-sources}'/>
    <arg value='-output ${output}'/>
    <arg value='-templates-path ${templates}'/>
    </exec>
    </target>
    </project>

    I hope this helps other mac users. If you find anything to further improve upon this, please send me an email.

  • 10 Jasonm // Aug 21, 2007 at 4:57 pm

    I’d strongly recommend splitting the property declarations off into a .properties file…

    –code–8

    (line 4 of the original)

  • 11 davebansal // Feb 13, 2008 at 5:38 pm

    was looking something exactly like this. initially i kept getting cairgorm and “type not found” errors. I resolved those by putting Cairngorm.swc under ${frameworks}/lib and by changing the in flex-config.xml. And now it works amazingly well. Thanks

Leave a Comment