Back when I was at Sun working on OpenSolaris, I decided that we needed a good web-based source browser to help show off the "product" (which was, essentially, the source code itself). At the time, we had a pilot site using CVSweb, which was easy to set up but (IMO) incredibly painful to use. In particular, it didn't have any support for cross-reference links (the ability to jump to the definition of a function or variable by clicking on the name in the source code), and the search capabilities were pretty minimal. I wanted something more usable for studying the source and general development activities; i.e., something that I (a diehard cscope user) would actually find useful in my own development work.
At the time, the state of the art was LXR, the Linux Cross-Reference system. LXR provides cross-reference support, as well as freetext searches (via Glimpse), but the setup was somewhat cumbersome, support for revision history seemed awkward, and there were licensing issues with Glimpse. Fortunately, it turned out that a Sun engineer was already playing around with web-based source browsers. We talked with Chandan about our requirements, and he agreed to work on a new source browser. The result was OpenGrok.
OpenGrok has actually been usable for a while as the source browser for OpenSolaris, but the source code was just released a couple of days ago. This means people can now download it and use it for whatever source tree they're interested in (including proprietary code). I did this recently with some internal VMware code, and (aside from a few minor issues that Chandan's working on fixing) it was remarkably easy. OpenGrok is all Java based and runs on top of Tomcat, so once you have a recent version of Java (1.5) and Tomcat set up, it's pretty simple (even for a Tomcat novice like me).
The result is a source browser that not only has the cross-reference links and freetext search capabilities of LXR, but supports syntax highlighting and has a nice clean look and feel. It's also completely free (in both senses) - released under the CDDL license. (I suppose some people may have problems with the Java dependency, but at least that's free-as-in-beer for everyone.) And, somewhat surprisingly given the fact that it's all Java, it's fast. I admit I was skeptical when I first heard that Chandan was planning to use a Java search engine (Apache Lucene), but the results are impressive. I'd suggest that anyone who spends much time looking at complex source trees check this out.
Recent Comments