Difference between revisions of "OpenGrok"

From CDOT Wiki
Jump to: navigation, search
m
m
Line 1: Line 1:
== Introduction ==
 
OpenGrok is the source browser in use by the OpenSolaris community.  It uses Java Servlets running on Java5
 
 
 
==Idea's==
 
Opengrok has 2 major componenets.  Opengrok.jar is a system independant Java Application that will index source code, which can then be viewed with its own internal client, or sent onto a Java Servlet for internet usage.  Source.war is the servlet that actually serves up the information.  <insert information when i feel like doing so>
 
 
== Features and Benefits ==
 
== Features and Benefits ==
==== File History ====  
+
==== File History ====
OpenGrok maintains code version history.  I am currently unsure of whether it looks at the CVS versioning information or whether it compares files between indexes. There is also options for many diffs and comparing different, non-concurrent versions.[http://cvs.opensolaris.org/source/history/on/usr/src/uts/sun/io/eri.c Example]
+
OpenGrok analyzes CVS versioning histories in order to get the versions. OpenGrok currently does not support branching properly.
 
 
After a little looking at the OpenSolaris OpenGrok, it seems that the version histories are more Wiki style than CVS style, so they are arbitrary
 
  
  
Line 21: Line 13:
  
 
==== Integrates Well ====
 
==== Integrates Well ====
The header and footer are completely customizable.  OpenGrok could be integrated with the current MDC potentially.  The header and footer are implemented through a variable which holds the copmlete html of the header and footer.
+
The header and footer are completely customizable.  OpenGrok could be integrated with the current MDC.
  
 
== Example Implementation ==
 
== Example Implementation ==
Line 37: Line 29:
 
   - tomcat5 tomcat5-admin tomcat5-webapps
 
   - tomcat5 tomcat5-admin tomcat5-webapps
 
     - Installs GNU Java which must be removed
 
     - Installs GNU Java which must be removed
   -make (using 3.81, may need 3.80)
+
   -make
 
   -CVS
 
   -CVS
 
* Run "sudo update-alternatives --config java" and "apt-get remove --purge java-gcj-compat"
 
* Run "sudo update-alternatives --config java" and "apt-get remove --purge java-gcj-compat"
Line 47: Line 39:
  
 
==== Important Info ====
 
==== Important Info ====
* /var/lib/tomcat5 is the default $CATALINA_HOME
+
* /var/lib/tomcat5 is the default $CATALINA_HOME for Ubuntu, but Ubuntu's packages are non-standard
 
* /etc/default/tomcat5 has some configuration files
 
* /etc/default/tomcat5 has some configuration files
 
* My SRC_ROOT is /var/mozilla
 
* My SRC_ROOT is /var/mozilla
* My DATA_ROOT is /var/tmp/opengrok_data
+
* My DATA_ROOT is /var/opengrok/data
* My run.sh uses a ctags at /usr/bin/ctags not the default
+
* My run.sh uses a ctags at /usr/bin/ctags not the default in the run.sh
* File permissions need to be changed [http://tomcat.apache.org/tomcat-5.0-doc/security-manager-howto.html this may help]
 
 
* Setting up the Admin webapp [http://www.onjava.com/pub/a/onjava/2003/06/25/tomcat_tips.html here]
 
* Setting up the Admin webapp [http://www.onjava.com/pub/a/onjava/2003/06/25/tomcat_tips.html here]
  
 
+
* [http://blogs.sun.com/chandan/entry/releasing_opengrok_0_3_subversion Blog about OpenGrok]
 
* [http://www.opensolaris.org/jive/thread.jspa?threadID=8934&tstart=30 Usefull topic for history info]
 
* [http://www.opensolaris.org/jive/thread.jspa?threadID=8934&tstart=30 Usefull topic for history info]
  
 
==Requirements==
 
==Requirements==
 
* be able to start/stop tomcat5/5.5 init.d script
 
* be able to start/stop tomcat5/5.5 init.d script
* write access to $cataline.home/webapps/
+
* write access to $catalina.home/webapps/
* wtite access to tomcat5/5.5 configuration files
+
* write access to tomcat5/5.5 configuration files
 
* have a non-home folder writable, personal preference for /var/mozilla
 
* have a non-home folder writable, personal preference for /var/mozilla
 
* Tomcat5 or 5.5
 
* Tomcat5 or 5.5

Revision as of 09:35, 9 November 2006

Features and Benefits

File History

OpenGrok analyzes CVS versioning histories in order to get the versions. OpenGrok currently does not support branching properly.


Blog about OpenGrok that explains file history better. This means that it is not really the best choice to use the CVS history information for indexing mozilla code because the history tracker will just use the newest version of the file, not the branch that it is in, thus, It would be a wise course of action to have either one opengrok webpp for each branch or have one opengrok with all versions in it.

Extendable

If there are files which cannot be analysed by the included analysers, OpenGrok allows the user to develop their own analysers, I am unsure of whether or not there is a JavaScript analyser allready, maybe even an XPCOM/XUL analyser could be written, but I don't know the first thing about XPCOM/XUL so this maybe allready implemented in another language.

In File Linking

The indexer hyperlinks all symbols to the file and line number of their declaration. If the symbol is in multiple files it shows a list of all files which have it.

Integrates Well

The header and footer are completely customizable. OpenGrok could be integrated with the current MDC.

Example Implementation

OpenSolaris

Installation Procedure

Notes

I will be listing notes for my own reference, feel free to use them

Steps

  • Install Ubuntu Linux as a server from the Ubuntu DVD
  • Install the following packages
 - ctags -> exuberant-ctags
 - sun-java5-jdk
 - tomcat5 tomcat5-admin tomcat5-webapps
   - Installs GNU Java which must be removed
 -make
 -CVS
  • Run "sudo update-alternatives --config java" and "apt-get remove --purge java-gcj-compat"
  • Change the tomcat5 config (/etc/default/tomcat5) to point to the new default Java runtime (/usr/lib/jvm/java-1.5.0-sun/) and disable the security manager, until that can be figured out
  • Setup a Mozilla code directory (mkdir /var/mozilla)
  • Follow guide at the OpenSolaris Project Guide
  • Enjoy!


Important Info

  • /var/lib/tomcat5 is the default $CATALINA_HOME for Ubuntu, but Ubuntu's packages are non-standard
  • /etc/default/tomcat5 has some configuration files
  • My SRC_ROOT is /var/mozilla
  • My DATA_ROOT is /var/opengrok/data
  • My run.sh uses a ctags at /usr/bin/ctags not the default in the run.sh
  • Setting up the Admin webapp here

Requirements

  • be able to start/stop tomcat5/5.5 init.d script
  • write access to $catalina.home/webapps/
  • write access to tomcat5/5.5 configuration files
  • have a non-home folder writable, personal preference for /var/mozilla
  • Tomcat5 or 5.5
  • Sun Java JRE and JDK 1.5.0
  • CTags
  • CVS and Subversion