1 Reply Latest reply on Oct 28, 2010 8:44 AM by Miggl

    ASDocs Error in ANT

    Miggl Level 1

      Hi All,

      I am desperately trying to get ASDocs to work with ANT. The following is the error I am currently getting:

       Error: Type was not found or was not a compile-time constant: Location.
      public var location:Location;

      I am referencing a class from another project (Location). How do I tell ASDocs to look up the definition in that secondary project? Here is my build.xml file:

      <?xml version="1.0" encoding="UTF-8" ?>
      <project name="leadlaw" basedir="." default="compile">
           <target name="compile" depends="checkout,CCBuild,generateAsDoc" />
           <target name="checkout">
                <exec executable="svn" dir="${basedir}/source">
                     <arg line="up" />
                </exec>
           </target>
           <target name="CCBuild">
                    <exec failonerror="true" executable="${basedir}/../../../FlexSDK4/bin/amxmlc">
                            <arg line="source/src/FlexUnitCompilerApplication.mxml -output source/src/FlexUnitCompilerApplication.swf" />
                         <arg line="-compiler.locale=en_GB,en_US" />
                         <arg line="-compiler.library-path  source/libs" />
                         <arg line="-compiler.library-path  ${basedir}/../../../FlexSDK4/frameworks/locale/en_US" />
                         <arg line="-compiler.library-path  ${basedir}/../../../FlexSDK4/frameworks/libs" />
                         <arg line="-compiler.library-path  ${basedir}/../../../FlexSDK4/frameworks/libs/air" />
                         <arg line="-compiler.library-path  ${basedir}/../../../FlexSDK4/frameworks/libs/automation" />
                         <arg line="-compiler.library-path  ${basedir}/../../../FlexSDK4/frameworks/libs/player" />
                    </exec>
               </target>
           <target name="cleanAsDoc" description="Clean ASDoc directory of old contents.">
                <delete dir="${basedir}/html_docs" failOnError="true" includeEmptyDirs="true" />
                <mkdir dir="${basedir}/html_docs" />
                <echo>Doc directory cleanded.</echo>
           </target>
           <target name="logAsDoc">
                <echo>ASDoc generation log started.</echo>
                <record name="${basedir}/html_docs/asdoc-log.txt" action="start" append="true" />
           </target>
           <target name="generateAsDoc" depends="cleanAsDoc,logAsDoc" description="Generate fresh ASDoc code documentation.">
                <exec executable="${basedir}/../../../FlexSDK4/bin/asdoc" failOnError="true">
                     <arg line="-doc-sources ${basedir}/source/src" />
                     <arg line="-source-path ${basedir}/source/src" />
                     <arg line="-external-library-path ${basedir}/source/libs" />
                     <arg line="-external-library-path ${basedir}/../modestmaps/source" />
                     <arg line="-window-title 'LeadLaw API Documentation'" />
                     <arg line="-main-title 'LeadLaw API Documentation'" />
                     <arg line="-footer 'Copyright 2010 RRP Lead Law. All rights reserved.'" />
                     <arg line="-output ${basedir}/html_docs" />
                </exec>
                <echo>API documentation created successfully.</echo>
           </target>
      </project>
      
      
      
      
      

      I imagine that adding some sort of external-library-path or similar should fix the issue. So far I haven't been able to get it to work (see the line with modestmaps). Any ideas?

      Thanks!

        • 1. Re: ASDocs Error in ANT
          Miggl Level 1

          I was able to solve this by using the following:

           

               <target name="generateAsDoc" depends="logAsDoc" description="Generate fresh ASDoc code documentation.">
                    <echo>Creating code documentation...</echo>
                    <exec executable="${basedir}/../../../FlexSDK4/bin/asdoc" failOnError="true">
                         <arg line="-doc-sources ${basedir}/source/src/com" />
                         <arg line="-source-path ${basedir}/../modestmaps/source/src" />
                         <arg line="-source-path ${basedir}/../components/source/src" />
                         <arg line="-source-path ${basedir}/source/src" />
                         <arg line="-external-library-path ${basedir}/source/libs" />
                         <arg line="-window-title 'LeadLaw API Documentation'" />
                         <arg line="-main-title 'LeadLaw API Documentation'" />
                         <arg line="-footer 'Copyright 2010 RRP Lead Law. All rights reserved.'" />
                         <arg line="-output ${basedir}/html_docs" />
                    </exec>
               </target>
          
          

           

          The difference is that I used additional "-source-path" declarations instead of "-external-library-path" for the dependent library code.