6 Replies Latest reply on Nov 5, 2010 8:42 AM by Happy Spud

    Correct setup for ASDoc?

    Happy Spud Level 1

      Hi all,


      I'm trying to get ASDoc working from within Flash Builder 4.0.1 (using the 4.1 SDK), but I'm constantly getting errors (mainly with my FlexUnit4 tests). I've a standard Flash Builder 4 file setup (i.e. if you created a new ActionScript project from the start menu).


      My arguments are:


      -source-path src
      -doc-sources src
      -exclude-classes 'C:\Documents and Settings\user\Adobe Flash Builder 4\project\src\uk\co\company\classes\requests\AbstractRequest.as' 'C:\Documents and Settings\user\Adobe Flash Builder 4\project\src\flexUnitTests\loadSWFTester.as'
      -exclude-sources src/BooleanSprite.as src/AltMain.as src/HighScoresDemo.as src/flexUnitTests/loadSWFTester.as src/com src/fl src/flexUnitTests/loadSWFTester.as src/flexUnitTests/BeforeClassTester.as src/flexUnitTests/MyAPIswfLoadFailTester.as src/flexUnitTests/signedInFalseTester.as src/flexUnitTests/loadSWFBeforeTester.as src/flexUnitTests/initTester.as
      -output DOCS


      I've tried to exclude the entire unit test directory from consideration but it doesn't seem to pay attention; giving me multiple "Error: Access of undefined property Async." errors. I know I've mismatched trying to exclude individual classes and directories above but neither have seemed to work.


      How should I therefore specify file paths, class paths, exclude paths in order to get this working? ASDoc's errror messages aren't very helpful sometimes. I've also tried adding @private above the methods which are erroring, to no avail. It always ends with the console tab displaying "Encountered too many errors!".

        • 1. Re: Correct setup for ASDoc?
          injpix Level 3

          You mentioned about placing a private attribute above methods, what about above the class instead?  This is how I am doing it:

           * exclude from ASDoc.
           * @private
          public class QueueManagerTest
          • 2. Re: Correct setup for ASDoc?
            Happy Spud Level 1

            It still gets incorporated into what ASDoc is doing (i.e. I still get the same error).

            • 3. Re: Correct setup for ASDoc?
              injpix Level 3

              Ah, well I believe when it does run with no errors that class will be 

              omitted from documentation.


              I typing from my phone and will not return back to my computer until 

              tomorrow, but look at some examples on github.com.  Mockolate has a 

              build.xml file that prevents linking for FlexUnit.  Hopefully that may 

              guide you.

              • 4. Re: Correct setup for ASDoc?
                Happy Spud Level 1

                I'll check it out, thanks for your help so far anyway

                • 5. Re: Correct setup for ASDoc?
                  injpix Level 3

                  Looking back at your original post, it seems that you haven't linked against FlexUnit.  If you viewed the build file I mentioned, you can see it links against libs.loc via the 'library-path' command-line option.


                  Below is my current project's build script, which is for a Flex Library for AIR.


                      <target name="document" depends="create">
                          <echo>Documenting AIRLoader, please wait a few seconds...</echo>
                          <java jar="${FLEX_HOME}/lib/asdoc.jar" fork="true" failonerror="true">
                              <arg line="+flexlib '${FLEX_HOME}/frameworks'" />
                              <arg line="-doc-sources '${src.loc}/com'" />
                              <arg line="-strict=false" />
                              <arg line="-source-path+='${src.loc}'" />
                              <arg line="-output '${doc.loc}'" />
                              <arg line="-library-path+='${FLEX_HOME}/frameworks/libs'" />
                              <arg line="-library-path+='${FLEX_HOME}/frameworks/libs/air'" />
                              <arg line="-library-path+='../flexunit/'" />
                              <arg line="-library-path+='../mockolate/target/bin/'" />
                              <arg line="-library-path+='../hamcrest-as3/target/bin/'" />
                              <arg line="-left-frameset-width 285" />
                              <arg line="-main-title '${build.artifactId} API Documentation'" />
                              <arg line="-window-title '${build.artifactId} API Documentation'" />


                  FLEX_HOME is the location of the SDK.  So as you may noticed, I am linking against some of Adobe's SWC files.  The flexunit, mockolate and hamcrest-as3 directories are git cloned repositories that I am using for this project.  I hope that helps.

                  • 6. Re: Correct setup for ASDoc?
                    Happy Spud Level 1

                    Considering there's supposed to be native support for FlexUnit4 in Flash Builder 4, I was confused as to exactly what I needed to setup and configure in order to get documents published.


                    I've tried with an example project from scratch and it's published docs ok.