Indexer.java revision 99
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* See LICENSE.txt included in this distribution for the specific
* language governing permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at LICENSE.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/**
* Creates and updates an inverted source index
* as well as generates Xref, file stats etc., if specified
* in the options
*/
public class Indexer {
"opengrok.jar [-qe] [-c ctagsToUse] [-H] [-R filename] [-W filename] [-U hostname:port] [-P] [-p project-path] [-w webapproot] [-i ignore_name [ -i ..]] [-n] [-s SRC_ROOT] DATA_ROOT [subtree .. ]\n" +
" opengrok.jar [-O | -l | -t] DATA_ROOT\n" +
"\t-q run quietly\n" +
"\t-e economical - consumes less disk space\n" +
"\t-c path to ctags\n" +
"\t-R Read configuration from file\n" +
"\t-W Write the current running configuration\n" +
"\t-U Send configuration to hostname:port\n" +
"\t-P Generate a project for each toplevel directory\n" +
"\t-p Use the project specified by the project path as the default project\n" +
"\t-n Do not generate indexes\n" +
"\t-H Start a threadpool to read history history\n" +
"\t-w root URL of the webapp, default is /source\n" +
"\t-i ignore named files or directories\n" +
"\t-m Maximum words in a file to index\n" +
"\t-S Search and add \"External\" repositories (Mercurial etc)\n" +
"\t-s SRC_ROOT is root directory of source tree\n" +
"\t default: last used SRC_ROOT\n" +
"\tDATA_ROOT - is where output of indexer is stored\n" +
"\tsubtree - only specified files or directories under SRC_ROOT are processed\n" +
"\t if not specified all files under SRC_ROOT are processed\n" +
"\n\t-O optimize the index \n" +
"\t-l list all files in the index \n" +
"\t-t lists tokens occuring more than 5 times. Useful for building a unix dictionary\n" +
"\n Eg. java -jar opengrok.jar -s /usr/include /var/tmp/opengrok_data rpc";
/**
* Program entry point
* @param argv argument vector
*/
boolean runIndex = true;
if (GraphicsEnvironment.isHeadless()) {
} else {
}
//Run Scope GUI here I am running Indexing GUI for testing
//new IndexerWizard(null).setVisible(true);
} else {
boolean searchRepositories = false;
boolean addProjects = false;
boolean refreshHistory = false;
// Parse command line options:
try {
} catch (ParseException ex) {
}
try{
int cmd;
switch (cmd) {
case 'D' :
break;
case 'O':
break;
case 'l':
break;
case 't':
break;
case 'g':
break;
case 'P': addProjects = true; break;
case 'w': {
;
} else {
}
} else {
}
}
break;
case 'R':
break;
case 'n': runIndex = false; break;
case 'H': refreshHistory = true; break;
case 's': {
if (!file.isDirectory()) {
}
break;
}
case 'S' : searchRepositories = true; break;
case 'm' : {
try {
} catch (NumberFormatException exp) {
}
break;
}
default:
}
}
if (optind != -1) {
++optind;
}
++optind;
}
}
}
try {
} catch (IOException e) {
}
}
}
}
}
if (!env.validateExuberantCtags()) {
}
if (searchRepositories) {
}
}
}
if (addProjects) {
}
}
// The projects should be sorted...
int ret;
} else {
}
return ret;
}
});
}
if (defaultProject != null) {
env.setDefaultProject(p);
break;
}
}
}
if (configFilename != null) {
}
}
}
if (refreshHistory) {
for (Map.Entry<String, ExternalRepository> entry : RuntimeEnvironment.getInstance().getRepositories().entrySet()) {
try {
} catch (Exception e) {
e.printStackTrace();
}
}
}
if (runIndex) {
Index idx = new Index(env.isVerbose() ? new StandardPrinter(System.out) : new NullPrinter(), new StandardPrinter(System.err));
}
if (configHost != null) {
}
try {
}
} else {
}
}
}
}
} catch (Exception e) {
}
}
}
}