2006-10-04

Must Have Software - OpenGrok

If you're a code monkey like me, then you've probably had to search through a source tree at one time or another - whether you're just a cog, or the whole machine.

Enter OpenGrok the "wicked fast source code browser".

From the project site:
OpenGrok is a fast and usable source code search and cross reference engine. It helps you search, cross-reference and navigate your source tree. It can understand various program file formats and version control histories like SCCS, RCS, CVS and Subversion. In other words it lets you grok (profoundly understand) the open source, hence the name OpenGrok. It is written in Java.
To see it in action:
  1. Visit the OpenSolaris Source Browser
  2. Search for "grok" via the Full Search field.
  3. Watch your results come back lightning fast!


Here's how it works: First you set loose OpenGrok's indexer on your codebase. This can take anywhere from a few minutes to several hours depending on code volume. When finished, you configure your WAR to point at the index and fire it up on your favorite J2EEish container (Tomcat worked great for me).

Here are some more features of OpenGrok:
  • Syntax Highlighting - Source code for recognized languages is syntax highlighted for ease of viewing.
  • Source Browsing - It's easy to walk up and down the directory structure of your code via /xref.
  • Project Descriptions - In the search results, notice the green italicized text next to the project names. These descriptions are configured via an optional CSV file.
  • Line Number Links - On the right hand side in the search results, line links take you directly to the matching line of the source code file.
If you or your organization have any appreciable amount of source code, OpenGrok will make you more effective at finding the information you require.

There are a few very desirable pieces missing from OpenGrok at present, which I hope to provide in future posts. Stay tuned.

1 comment:

Unknown said...

I've been thinking of setting up a personal OpenGrok for my SVN repo and I would also like to "grok" google's code search. Is there a guide that you would recommend to assist in setting up OpenGrok.
Thanks in advance!

-gindogg