At first glance one might think the ability to run asdoc.exe against an AIR project would be pretty much the same as compiling ASDocs for a typical Flex project – but it’s not.
I recently completed updating my AIRCairngorm project and decided to compile the source code documentation as I always do, however when I attempted to do so my build failed. Based on the exceptions asdoc.exe was throwing it was pretty obvious the build was failing because none of the classes in the AIR API could be resolved.
I did a quick Google search and unfortunately there wasn’t much out there explaining how to resolve the errors. After a little more digging around and exploring of the sdk I was able to fix the build. Basically asdoc.exe needs to point to air-config.xml as well as the location of the air swc’s.
Below is the final build I am using which will allow you to compile ASDocs for your AIR projects:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | <!-- Adobe AIR ASDoc ANT Tasks --> <project name="AIR ASDoc build" default="main" > <!-- defines all values for the ASDoc compiler --> <property file="asdoc.properties" /> <!-- main target: cleans and compiles ASDocs --> <target name="main" depends="clean, create-docs" /> <!-- deletes and recreates the asdoc directory --> <target name="clean" > <delete dir="${output.dir}" /> <mkdir dir="${output.dir}" /> </target> <!-- runs the asdoc.exe compiler on the source --> <target name="create-docs" > <exec executable="${asdoc.exe}" failonerror="true" > <arg line="-doc-sources ${src.dir}" /> <arg line="-output ${output.dir}" /> <arg line="-load-config '${frameworks}/air-config.xml'"></arg> <arg line="-library-path '${frameworks}/libs/'"></arg> <arg line="-library-path '${frameworks}/libs/air'"></arg> </exec> </target> </project> |
You will also need the asdoc.properties file to go along with it:
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Modify the following properties to match your environment # By default, the asdoc.exe property points to the location of # asdoc.exe on Windows sdk.dir=C:/Program Files/Adobe/Flex Builder 3 Plug-in/sdks/3.0.0 frameworks =${sdk.dir}/frameworks src.dir =C:/workbench/clients/AIRCairngorm/ asdoc.exe =${sdk.dir}/bin/asdoc.exe main.title =AIR Project title window.title =Window title output.dir =C:/workbench/asdoc |
So if you happen to run into this problem in the future you can use the ASDocAntTask project to compile ASDocs for your AIR projects without the headaches.
“I recently completed updating my AIRCairngorm project”
Are the zip files updated on the original post then, or are you waiting to release the updates?