Share & Learn

Tuesday, August 19, 2008

Building ASDoc with Maven-Flex Plugin

Problem: Building ASDoc with Maven

Solution: Paste the following <plugin> information under the <plugins> </plugins> section of your pom.xml

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>generate-asdoc</id>
<phase>package</phase>
<configuration>
<tasks>
<echo>Generating asDoc documentation</echo>
<mkdir dir="${basedir}/target/apiDocs" />
<property file="${basedir}/src/main/asDoc/asdoc.properties" />
<exec executable="${flex.home}/bin/asdoc.exe" failonerror="false" >
<arg line="-doc-sources '${srcdoc}'" />
<arg line="-library-path+='${flex.home}/frameworks/libs'"/>
<arg line="-main-title '${main.title}'" />
<arg line="-window-title '${window.title}'" />
<arg line="-output '${output.dir}'" />
<arg line="-footer ${footer}" />
<arg line="-left-frameset-width ${leftFramesetWidth}" />
<arg line="-source-path '${srcdoc}'" />
<!-- If you are using any external libraries such as Cairngorm.swc or flexlibs.swc then you need to specify them in this manner -->
<!-- <arg line="-external-library-path '${flexlib}'" />
<arg line="-external-library-path+='${cairngorm}'" /> -->
</exec>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>

It took me 20 mins to get this done, for you it should take 2 mins. If this helps you let me know.

AsDoc.properties file contains the following

srcdoc ='${basedir}/src'
main.title = Priyank Examples
window.title = Priyank Examples
output.dir ='${basedir}/target/apiDocs'
footer ="© 2008 Priyank Examples"
leftFramesetWidth="200"
flexlib="${basedir}/src/main/swc/flexlib.swc"
cairngorm="${basedir}/src/main/swc/cairngorm.swc"

blog comments powered by Disqus
blog comments powered by Disqus