« Quote of the day
» FDT Templates for PureMVC, Spark, and ASDocs

General

ASDoc Gotchas

01.05.11 | Written by: Scott
Scott

I’ve recently been trying to create an Ant script to generate ASDoc style documentation for some shared common code libraries.  I’ve run into a number of  issues and it was hard to find any good documentation or blog posts to help me solve my problems.  So I am going to cover some of the issues I had and provide some example code of the Ant script I ended up using to get my ASDoc generation to work.

Vector

One of the first issues I had was with the newer Vector class. I would see the following error when trying to generate the docs:

Type was not found or was not a compile-time constant: Vector

The reason was by default the target player was set to 9.  I am using the 3.5 version of the Flex SDK and 3.5 can export to Flash Player 9 or 10.  The Vector class was introduced in version 10.  So it is necessary to set the compiler option target-player to 10.0.0.  I posted something about it here.

Cannot find swc classes

Some of my custom classes made use of classes from other frameworks.  I ended up with errors saying it could not find those framework classes.  I needed to let the asdoc.exe know where to find those source files.  This was fixed by providing the external-library-path compiler option.  I needed to point it to the libs folder where the swc files reside.

Cannot transcode

Some of the classes embedded assets using the Embed metadata tags.  I got errors saying it couldn’t transcode those assets.  This was because the asdoc.exe didn’t know where to look for the relative asset paths.  I needed to add the source-path compiler option to point to the source directory.

I hope this will help anyone else that runs into the same issues I had.  Check out this example build.xml file.  (If viewing in Google Chrome, make sure to right click on the page and view source to see the xml)

Tags: ,

have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

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="" cssfile="">

:

:


« Quote of the day
» FDT Templates for PureMVC, Spark, and ASDocs