diff --git a/README.md b/README.md index d25de77..001b956 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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= --action=setup +# make changes to your project +python grokit.py --ppath= --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 diff --git a/src/.gitignore b/src/.gitignore new file mode 100644 index 0000000..0083c2e --- /dev/null +++ b/src/.gitignore @@ -0,0 +1,2 @@ +grokit_files + diff --git a/src/grokit.py b/src/grokit.py index 6955139..0a57ac3 100644 --- a/src/grokit.py +++ b/src/grokit.py @@ -24,6 +24,9 @@ def format_epilog(self, formatter): grokit.exe --action=start grokit.exe --action=stop + 3. Reindex project + grokit.exe --ppath= --action=reindex + Please send your comments / suggestions to raghu.sesha@gmail.com """ @@ -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""" diff --git a/src/platdefines.py b/src/platdefines.py index 5646017..af16828 100644 --- a/src/platdefines.py +++ b/src/platdefines.py @@ -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' } } diff --git a/src/tools/apache-tomcat-9.0.5.tar.gz b/src/tools/apache-tomcat-9.0.24.tar.gz similarity index 51% rename from src/tools/apache-tomcat-9.0.5.tar.gz rename to src/tools/apache-tomcat-9.0.24.tar.gz index 3792664..01b7425 100644 Binary files a/src/tools/apache-tomcat-9.0.5.tar.gz and b/src/tools/apache-tomcat-9.0.24.tar.gz differ diff --git a/src/tools/exuberant-ctags.tar b/src/tools/exuberant-ctags.tar deleted file mode 100644 index d1962f1..0000000 Binary files a/src/tools/exuberant-ctags.tar and /dev/null differ diff --git a/src/tools/opengrok-1.1-rc21.tar.gz b/src/tools/opengrok-1.1-rc21.tar.gz deleted file mode 100644 index 2f10479..0000000 Binary files a/src/tools/opengrok-1.1-rc21.tar.gz and /dev/null differ diff --git a/src/tools/opengrok-1.3.1.tar.gz b/src/tools/opengrok-1.3.1.tar.gz new file mode 100644 index 0000000..960a937 Binary files /dev/null and b/src/tools/opengrok-1.3.1.tar.gz differ diff --git a/src/tools/universal-ctags.tar.gz b/src/tools/universal-ctags.tar.gz new file mode 100644 index 0000000..d65b0dd Binary files /dev/null and b/src/tools/universal-ctags.tar.gz differ diff --git a/src/utils.py b/src/utils.py index 7d2df0f..711cf9a 100644 --- a/src/utils.py +++ b/src/utils.py @@ -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 @@ -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): @@ -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