Doxygen and Eclox plugin

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…

Screen Shot 2014-02-17 at 12.48.21 PM

Click Add and add the Eclox repository: http://download.gna.org/eclox/updates

Screen Shot 2014-02-17 at 12.50.19 PM

Install Eclox and Eclox Hot.

Screen Shot 2014-02-17 at 12.48.51 PM

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…

Screen Shot 2014-02-17 at 12.53.12 PM

From the wizard choose doxyfile

Screen Shot 2014-02-17 at 12.53.34 PM

and give your doxyfile a name

Screen Shot 2014-02-17 at 12.53.46 PM

Open the newly created doxyfile in Eclipse. You should see a menu with a series of options.

Screen Shot 2014-02-17 at 12.54.18 PM

This diagram shows a typical configuration for my Android projects

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

Screen Shot 2014-02-17 at 1.09.03 PM

Next, choose your doxyfile. Click the menu beside the @ sign in the menu bar and choose the doxyfile you want to run.

Screen Shot 2014-02-17 at 12.54.34 PM

Doxygen should run for that doxyfile. Check the console for any errors and fix them as necessary.

 

Acknowledgements

Eclox website: http://download.gna.org/eclox/updates

Doxygen website: http://www.stack.nl/~dimitri/doxygen/

And Google is your friend!

 

Advertisements
Posted in Android Development
One comment on “Doxygen and Eclox plugin

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: