Changes

Jump to: navigation, search

OpenGrok

1,278 bytes removed, 22:37, 12 November 2008
OpenGrok
== Introduction ==OpenGrok is a source code searcher similar in idea to MXR. It is very advanced and written in Java. It uses Apache Lucene to build a search database for a source code tree. This tool is perfect for the source browser new mercurial repository as it has built in hg repo parsing. There is only version number searching capability I think: you can't use by , for example, FIREFOX_3_1b1_RELEASE in the OpenSolaris communityHistory box. If there is interest in Mozilla adopting this program, I'd be willing to write support for it. It uses Java Servlets running on Java5I'd also like to customize the look and feel for the Mozilla web sites. I have a list of things to do in my script.
[[OpenGrok/script|The Script]]
==Idea'sSetup==Opengrok has 2 major componenetsSetting this up is fairly easy if you know your way around a unix shell. OpengrokYou will need the following tools:* JDK 1.jar is a system independant Java Application that will index source code5+* Servlet container - JBoss, Glassfish, Tomcat, which can then be viewed with its own internal clientJetty, or sent onto a Java Servlet for internet usageetc. Source.war is the servlet that actually serves up the information. <insert information when i feel like doing so>== Features and Benefits ==* Exuberant Ctags==== File History ==== * MercurialOpenGrok 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* Basic unix programs: sed, zip, unzip, nice, non-concurrent versions.[http://cvs.opensolaris.org/source/history/on/usr/src/uts/sun/io/eri.c Example]bash
After a little looking at I am assuming you have set up all the OpenSolaris OpenGrok, it seems that the version histories are more Wiki style than CVS style, so they are arbitraryrequired applications installed and configured.
You are going to need to download the opengrok binary release tarball from [http://opensolaris.org/os/project/opengrok/ OpenGrok]. Untar it (tar zxf opengrok-0.7.tar.gz) and make note of the directory you put it in. Next you will configure the following variables in my script:
<pre>
#Mercurial Repository to use
REPO=http://hg.mozilla.org/mozilla-central <-- Change to your HG Repo
[http:#Base directory for contentsBASEDIR=/home/blogs.sun.comjhford/chandan/entry/releasing_opengrok_0_3_subversion Blog about OpenGrok] that explains file history better. mozilla <-- This means that it is not really the best choice to use the CVS history information base directory for indexing mozilla code because the history tracker will just use the newest version of the file, not OpenGrok data files and 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.HG repo
==== Extendable ====If there are files which cannot be analysed by #This is the name of the included analysers, data directory for OpenGrok allows DATADIR=data-dir <-- This is 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 donfolder *name* for opengrok't know the first thing about XPCOM/XUL so this maybe allready implemented in another language. s data
==== In File Linking ====The indexer hyperlinks all symbols to #This is the file and line number name of their declaration. If the symbol source directory for OpenGrokSRCDIR=src-dir <-- This is in multiple files it shows a list the folder *name* for opengrok's copy of all files which have it.HG code
#OpenGrok install path - Where is opengrok.jar?OGDIR==== Integrates Well ====The header and footer are completely customizable"/home/jhford/opengrok/opengrok-0. 7" <-- this is where the OpenGrok could be integrated with the current MDC potentiallytarball files ended up. It is likely where you ran "tar zxf opengrok-0.7. The header and footer are implemented through a variable which holds the copmlete html of the header and footertar.gz"
#OpenGrok source.war from opengrok tarballOGCONTEXT== Example Implementation ==["grokzilla" <-- this variable defines the grokzilla in http://cvschina:8080/grokzilla OGWAR="${OGCONTEXT}.opensolaris.org/source/ OpenSolaris]war" <-- Likely, you will never need to change this
== Installation Procedure ==#Your application server's .war deployment directoryWEBAPPDIR==== Notes ===="/home/jhford/tomcat/apache-tomcat-6.0.18/webapps" <-- This is where your app server's war deployment folder is or where you want the resulting war fileI will be listing notes for my own reference, feel free to use them<pre>
==== 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 (using 3.81, may need 3.80) -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 Then run the new default Java runtime (/usr/lib/jvm/java-1.5.0-sun/) script and disable the security manager, until notice that can be figured out* Setup a Mozilla code directory (mkdir /var/mozilla)* Follow guide at the [http://www.opensolaris.org/os/project/you have opengrok/manual OpenSolaris Project Guide]* Enjoy!  ==== Important Info ====* /var/lib/tomcat5 is the default $CATALINA_HOME* /etc/default/tomcat5 has some configuration files* My SRC_ROOT is /var/mozilla* My DATA_ROOT is /var/tmp/opengrok_data* My run.sh uses a ctags It will likely show up at /usr/bin/ctags not the default* 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 [httplocalhost:8080//www.onjava.com/pub/a/onjava/2003/06/25/tomcat_tips.html here]  * [http://www.opensolaris.org/jive/thread.jspa?threadID=8934&tstart=30 Usefull topic for history info]grokzilla
1
edit

Navigation menu