Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for opengrok #2

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Alt text](grokit.jpg?raw=true "grokit")

grokit is a developer's tool to setup one of the best available source code search and cross reference engines, [`Opengrok`](http://opengrok.github.io/OpenGrok/).
grokit is a developer's tool to setup one of the best available source code search and cross reference engines, [`Opengrok`](https://oracle.github.io/opengrok/).
This repository contains the source code (without external dependencies) for grokit. If you want to simply download and use grokit with all its dependencies, please visit [`grokit webpage`](http://grokit.pythonanywhere.com)

Dependencies
Expand All @@ -10,33 +10,34 @@ Dependencies
- [`lxml`](https://pypi.python.org/pypi/lxml)

### Tools
- [`Opengrok`](http://opengrok.github.io/OpenGrok/) (ofcourse!)
- [`JRE`](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
- [`exuberant-ctags`](http://ctags.sourceforge.net/)
- [`Opengrok`](https://oracle.github.io/opengrok/) (ofcourse!)
- [`JRE 8`](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
- [`universal-ctags`](https://github.com/universal-ctags/ctags)
- [`Apache Tomcat`](http://tomcat.apache.org/)


### Installation
Download jre-8u162 and place the downloaded tar.gz in the tools directory.

Usage:
------------
```ruby
# Clone the repository
git clone https://github.com/raghusesha/grokit.git
# Download and copy the dependent tools (check the section above) into the tools directory
cd grokit/tools
# download opengrok. e.g., wget http://java.net/projects/opengrok/downloads/download/opengrok-0.12.1.tar.gz
# download jre, ctags and tomcat
cd grokit/src/tools
# download java jre-8
# for Windows also download: ctags, tomcat and opengrok. e.g., wget http://java.net/projects/opengrok/downloads/download/opengrok-0.12.1.tar.gz
cd ..
# edit platdefines.py so the tool names and file sizes are correct
python grokit.py --ppath=<path to project source> --action=setup
# make changes to your project
python grokit.py --ppath=<path to project source> --action=reindex
```
For instant setup and using the tool,
Check the videos: http://www.youtube.com/watch?v=XzrPlAfiC1w and http://www.youtube.com/watch?v=BTGnZShDiqA

Platforms Tested On:
------------
### Linux
### Linux
- Ubuntu 14.04 64 bit
- Ubuntu 12.04 64 bit
- Ubuntu 11.04 64 bit

Expand Down
2 changes: 2 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
grokit_files

6 changes: 5 additions & 1 deletion src/grokit.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ def format_epilog(self, formatter):
grokit.exe --action=start
grokit.exe --action=stop

3. Reindex project
grokit.exe --ppath=<path to project source> --action=reindex

Please send your comments / suggestions to raghu.sesha@gmail.com
"""

Expand All @@ -33,8 +36,9 @@ def format_epilog(self, formatter):
So, if you want single project, make sure that PPATH has only one child directory that contains all source files"""

action_help="""
Action to be performed. Can be one of (setup|start|stop):
Action to be performed. Can be one of (setup|reindex|start|stop):
- setup: Setup opengrok for the project source present at PPATH.
- reindex: reindex changed project source.
- start: Start the tomcat server
- stop: Stop the tomcat server"""

Expand Down
24 changes: 12 additions & 12 deletions src/platdefines.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,24 @@ def convert_to_os_path(path):
return newpath

tools_dict = \
{ 'tomcat' : { 'file_name': 'apache-tomcat-9.0.5.tar.gz',
'file_size': 9475699,
'extract_dir' : 'apache-tomcat-9.0.5',
{ 'tomcat' : { 'file_name': 'apache-tomcat-9.0.24.tar.gz',
'file_size': 10914435,
'extract_dir' : 'apache-tomcat-9.0.24',
'bin_file': '.sh'
},
'opengrok' : { 'file_name' : 'opengrok-1.1-rc21.tar.gz',
'file_size': 17492505,
'extract_dir' : 'opengrok-1.1-rc21',
'opengrok' : { 'file_name' : 'opengrok-1.3.1.tar.gz',
'file_size': 48057315,
'extract_dir' : 'opengrok-1.3.1',
'bin_file': 'opengrok.jar'
},
'jre': { 'file_name' : 'jre-8u162-linux-x64.tar.gz',
'file_size': 80107578,
'extract_dir' : 'jre1.8.0_162',
'jre': { 'file_name' : 'jre-8u221-linux-x64.tar.gz',
'file_size': 87964916,
'extract_dir' : 'jre1.8.0_221',
'bin_file': 'java'
},
'ctags': { 'file_name' : 'exuberant-ctags.tar',
'file_size': 921600,
'extract_dir' : 'ctags58',
'ctags': { 'file_name' : 'universal-ctags.tar.gz',
'file_size': 1455298,
'extract_dir' : 'uctags',
'bin_file': 'ctags'
}
}
Expand Down
Binary file not shown.
Binary file removed src/tools/exuberant-ctags.tar
Binary file not shown.
Binary file removed src/tools/opengrok-1.1-rc21.tar.gz
Binary file not shown.
Binary file added src/tools/opengrok-1.3.1.tar.gz
Binary file not shown.
Binary file added src/tools/universal-ctags.tar.gz
Binary file not shown.
10 changes: 6 additions & 4 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ def copy_war(tdir, tomdir, ppath):
print myself()
modified_war = ospath(tdir +"/"+os.path.basename(ppath)+".war")
destfile = ospath(tomdir + "/webapps/")
print modified_war
print destfile
print "Copying war file."
try:
shutil.copy(modified_war, destfile)
return True
Expand Down Expand Up @@ -231,6 +230,10 @@ def check_and_copy_tools(envs):
if tools_present(envs) == True:
if extract_and_copy(envs) == True:
return True
else:
return False
else:
print "Tools not present."
return False

def tools_present(envs):
Expand Down Expand Up @@ -313,8 +316,7 @@ def index_og(envs):
ctags = convert_to_os_path(get_tool_dir('ctags', envs)+"/"+get_tool_property('ctags','bin_file'))
src = convert_to_os_path(envs['ppath'])
data = convert_to_os_path(get_temp_dir(envs)+"/data")
webapp = os.path.basename(envs['ppath'])
cmd = java+" -jar "+opengrok+" -W "+config+" -c "+ctags+" -P -S -s "+src+" -d "+data+" -w "+webapp
cmd = java+" -jar "+opengrok+" -W "+config+" -c "+ctags+" -P -S -s "+src+" -d "+data
try:
os.system(cmd)
return True
Expand Down