Wednesday, January 26, 2011

How to setup Asdoc for Eclipse:

Give me the right tools and I shall build the world...well what happens if they do not come with instructions?  And of course, what is the use of the most brilliant code without documentations on what they are for?  Having said that, programmers really need to write documentations on the code that they wrote...

After writing the documentation, you would of course want to have it some where online to easily look through it.  Ask and you shall receive, so you have AsDoc...

Below are steps to set up your eclipse to generate asdocs for AS3.

    
Step 1-
Open External Tools. Run Menu->External Tools->External Tools...



Step 2-
Click on Program and click on the white rectangle to create a new configuration.



Step 3-
In the Name text field type in AsDoc or whatever you want to name this configuration that generates asdocs.

Step 4-
In the Location text field, type in the location of your asdoc.exe file. If you don't already have a copy of Flex SDK, then grab one before proceeding.  For this example I have saved it to:
C:\Program Files (x86)\Adobe\Flex Builder 3 Plug-in\sdks\4.1.0\bin\asdoc.exe

Step 5-
In the Working Directory text field, type in the working folder that you are currently using.

Step 6-
In the Arguments text field, type in any arguments you want to add when generating asdocs. 
For the complete list you can check out this Adobe Flex 4 Asdocs.  In this example I only used the bare minimum, which is:
-doc-sources C:\Projects\MyProject
-output C:\Projects\MyProject\doc
-main-title "My Project API"
-window-title "My Project API"

-doc-sources is the folder you wish to generate the asdocs.  Asdoc.exe will look for all the ".as" files in this folder, so do not worry if you have folders within folders in this folder.  Asdoc will search and generate.
-output is obviously will be the location you wish to save the asdoc files.
-main-title is the text that appears at the top of the HTML pages in the output documentation.
-window-title is the text that appears in the browser window in the output documentation.

Step 7-
Click Apply and Run


Related Links:
Flex SDK      
Adobe Flex 4 Asdocs  

2 comments: