Doxygen and Eclox
Doxygen generates documentation from annotated source code. As the website states:
Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl, and to some extent D.
This post is about how to integrate Doxygen into Eclipse via the Eclox Plugin.
Step 1: Install Doxygen
All users (Mac, Linux, Windows) can download the latest version of doxygen from the download page on the website. Doxygen should be in the repositories of most Linux versions, so you may install it via your package manager (apt-get, yum, etc.), however, this may not be the latest version. Mac users can also install doxygen via homebrew.
Step 2: Install Eclox
These are instructions for the Mac version of Eclipse Kepler. Windows and Linux users adapt these to your system.
Go to Help->Install New Software…
Click Add and add the Eclox repository: http://download.gna.org/eclox/updates
Install Eclox and Eclox Hot.
Restart Eclipse when prompted.
Step 3: Create Doxyfile
The next step is to create the doxyfile for your project. The doxyfile contains settings that helps doxygen generate documentation for your source code. The Eclox plugin provides a convenient interface for configuring Doxyfiles
To create a Doxyfile, open your project and right click on the project. Choose New->Other…
From the wizard choose doxyfile
and give your doxyfile a name
Open the newly created doxyfile in Eclipse. You should see a menu with a series of options.
Be sure the input directory is ‘ . ‘ and the “Scan Recursively” box is checked. Also be sure that Doxygen is optimized for Java documentation. Extracting from All Entities will generate documentation for methods that have not been given doxygen documentation.
Step 4: Document your source code
Doxygen will automatically generate documentation for many of the structures and parameters in your source code, however, you will probably want better documentation than this. The doxygen manual gives full information about how to properly format your code and code comments to generate doxygen documentation.
Step 5: Run Doxygen
The first time you run Eclox, Eclox may ask you where to find doxygen. You will need to provide the directory that contains the doxygen executable, not the doxygen executable itself.
You can change this in Preferences->Doxygen
Next, choose your doxyfile. Click the menu beside the @ sign in the menu bar and choose the doxyfile you want to run.
Doxygen should run for that doxyfile. Check the console for any errors and fix them as necessary.
Eclox website: http://download.gna.org/eclox/updates
Doxygen website: http://www.stack.nl/~dimitri/doxygen/
And Google is your friend!