AsDoc with FDT

AsDoc is a very useful tool for documenting the API of your classes particularly if you work in a team. Unfortunately it is not implemented in FDT but as it is a command line tool and included in the Flex 3 SDK you can use it via an ant buildfile. The following examples are for Mac OSX users but it should work on Windows with a few changes as well.

Creating the files
Create two files ‘build_project.properties’ and ‘build.xml’ and put it in your project root folder.

build_project.properties
In this file you can make all your project and platform specific settings.

common.flex3dir     = /Applications/eclipseBase/flex_sdk_3/
common.flex3bindir  = ${common.flex3dir}/bin
common.asdoc        = ${common.flex3bindir}/asdoc
 
project.src = ${basedir}/src
project.doc = ${basedir}/doc

build.xml
Ant uses ‘build.xml’ files to automate your build

< ?xml version="1.0"?>
<project name="testAsDoc" default="asdoc">
	<!-- import the settings -->
	<property file="${basedir}/build_project.properties"/>
 
	<target name="asdoc">
		<!-- delete all files in the doc dir -->
		<delete includeemptydirs="true">
			<fileset dir="${project.doc}" includes="**/*" />
		</delete>
		<!-- create docs -->
		<exec executable="${common.asdoc}"> 
		    <arg line="	-doc-sources '${project.src}' 
		    		-output '${project.doc}' 
		    		-main-title 'Test API' 
		    		-window-title 'Test API'" /> 
		</exec>
	</target>
 
</project>

run AsDoc
Drag&Drop the ‘build.xml’ to the Ant window and doubleclick on it to start AsDoc.
Ant window

postcompile AsDoc
Alternatively you can specify your ‘build.xml’ to postcompile after every build process in your ‘Run Dialog’
postcompile



8 Responses (Add Your Comment)

  1. nice! thx

  2. above is not well formatted after copy-paste. Fix it, and everything will be ok.

  3. Does this work for using Properties>Ant>New Task?

  4. I got it working`-` My set up is a little different so I changed some settings. By the way where is the Flex 3sdk on FDT using the standalone? I looked in plugins but could not find it.

    This is great, and I am so happy to have this working. I would love to set this up as a general property that is set up when I create a new flash project in FDT.

    Thanks,
    Johnny

  5. hey john, the SDK that comes with FDT resides in the plugins directory, in my case: eclipse/plugins/com.powerflasher.fdt.shippedflex_3.3.0.4852_1000. I’m not sure about the standalone version but should be pretty much the same.

    You could set up a runtime property with the path, so it’ll be available to every ANT script. You can do it via Settings>Ant>Runtime> Properties > Add Property…

    for any further questions just post a comment or send an email.

    cheers Martin

  6. Nice!! Thanks!

  7. Works like a charm (after fixing the markup).
    I had to google how to specify external libraries, but that’s just my poor asdoc skills :)

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>

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