Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 41 additions & 10 deletions opengrok-web-nbproject/nbproject/build-impl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,24 @@
<condition property="do.display.browser">
<istrue value="${display.browser}"/>
</condition>
<condition property="do.display.browser.debug.old">
<and>
<isset property="do.display.browser"/>
<not>
<isset property="do.debug.client"/>
</not>
<not>
<isset property="browser.context"/>
</not>
</and>
</condition>
<condition property="do.display.browser.debug">
<and>
<isset property="do.display.browser"/>
<not>
<isset property="do.debug.client"/>
</not>
<isset property="browser.context"/>
</and>
</condition>
<available file="${conf.dir}/MANIFEST.MF" property="has.custom.manifest"/>
Expand Down Expand Up @@ -445,7 +457,7 @@ or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties f
</condition>
<union id="test.set"/>
<taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
<testng classfilesetref="test.set" failureProperty="tests.failed" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="opengrok-web-nbproject" testname="TestNG tests" workingDir="${basedir}">
<testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="opengrok-web-nbproject" testname="TestNG tests" workingDir="${basedir}">
<xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
<propertyset>
<propertyref prefix="test-sys-prop."/>
Expand Down Expand Up @@ -947,28 +959,28 @@ exists or setup the property manually. For example like this:
<dirname file="${dist.war}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
<jar compress="${jar.compress}" jarfile="${dist.war}">
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*"/>
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
</jar>
</target>
<target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.with.custom.manifest" name="-do-dist-with-manifest">
<dirname file="${dist.war}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
<jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*"/>
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
</jar>
</target>
<target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.without.custom.manifest" name="-do-tmp-dist-without-manifest">
<dirname file="${dist.war}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
<jar compress="${jar.compress}" jarfile="${dist.war}">
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*"/>
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
</jar>
</target>
<target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.with.custom.manifest" name="-do-tmp-dist-with-manifest">
<dirname file="${dist.war}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
<jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*"/>
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
</jar>
</target>
<target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
Expand Down Expand Up @@ -1003,7 +1015,7 @@ exists or setup the property manually. For example like this:
<dirname file="${dist.ear.war}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
<jar compress="${jar.compress}" jarfile="${dist.ear.war}" manifest="${build.web.dir}/META-INF/MANIFEST.MF">
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*"/>
<fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
</jar>
</target>
<target name="-post-dist">
Expand Down Expand Up @@ -1052,18 +1064,32 @@ exists or setup the property manually. For example like this:
<target depends="init,-pre-dist,dist,-post-dist" name="verify">
<nbverify file="${dist.war}"/>
</target>
<target depends="run-deploy,-init-display-browser,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
<target depends="run-deploy,-init-display-browser,-display-browser-nb-old,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
<target if="do.display.browser" name="-init-display-browser">
<condition property="do.display.browser.nb.old">
<and>
<isset property="netbeans.home"/>
<not>
<isset property="browser.context"/>
</not>
</and>
</condition>
<condition property="do.display.browser.nb">
<isset property="netbeans.home"/>
<and>
<isset property="netbeans.home"/>
<isset property="browser.context"/>
</and>
</condition>
<condition property="do.display.browser.cl">
<isset property="deploy.ant.enabled"/>
</condition>
</target>
<target if="do.display.browser.nb" name="-display-browser-nb">
<target if="do.display.browser.nb.old" name="-display-browser-nb-old">
<nbbrowse url="${client.url}"/>
</target>
<target if="do.display.browser.nb" name="-display-browser-nb">
<nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
</target>
<target if="do.display.browser.cl" name="-get-browser" unless="browser">
<condition property="browser" value="rundll32">
<os family="windows"/>
Expand Down Expand Up @@ -1131,6 +1157,7 @@ exists or setup the property manually. For example like this:
<nbstartserver debugmode="true"/>
<antcall target="connect-debugger"/>
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="true" forceRedeploy="true"/>
<antcall target="debug-display-browser-old"/>
<antcall target="debug-display-browser"/>
<antcall target="connect-client-debugger"/>
</target>
Expand All @@ -1147,9 +1174,12 @@ exists or setup the property manually. For example like this:
</sourcepath>
</nbjpdaconnect>
</target>
<target if="do.display.browser.debug" name="debug-display-browser">
<target if="do.display.browser.debug.old" name="debug-display-browser-old">
<nbbrowse url="${client.url}"/>
</target>
<target if="do.display.browser.debug" name="debug-display-browser">
<nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
</target>
<target if="do.debug.client" name="connect-client-debugger">
<webproject1:nbjsdebugstart webUrl="${client.url}"/>
</target>
Expand Down Expand Up @@ -1244,6 +1274,7 @@ exists or setup the property manually. For example like this:
<startprofiler/>
<nbstartserver profilemode="true"/>
<nbdeploy clientUrlPart="${client.urlPart}" forceRedeploy="true" profilemode="true"/>
<antcall target="debug-display-browser-old"/>
<antcall target="debug-display-browser"/>
<antcall target="-profile-start-loadgen"/>
</target>
Expand Down
3 changes: 3 additions & 0 deletions src/org/opensolaris/opengrok/index/IndexDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,9 @@ public static Definitions getDefinitions(File file)
throws IOException, ParseException, ClassNotFoundException {
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
String path = env.getPathRelativeToSourceRoot(file, 0);
//sanitize windows path delimiters
//in order not to conflict with Lucene escape character
path=path.replace("\\", "/");

IndexReader ireader = getIndexReader(path);

Expand Down
9 changes: 9 additions & 0 deletions test/org/opensolaris/opengrok/index/IndexDatabaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ public void testGetDefinitions() throws Exception {
assertTrue(defs1.hasSymbol("a"));
assertFalse(defs1.hasSymbol("b"));
assertTrue(defs1.hasDefinitionAt("foobar", 1, new String[1]));

//same for windows delimiters
f1 = new File(repository.getSourceRoot() + "\\c\\foobar.c");
defs1 = IndexDatabase.getDefinitions(f1);
assertNotNull(defs1);
assertTrue(defs1.hasSymbol("foobar"));
assertTrue(defs1.hasSymbol("a"));
assertFalse(defs1.hasSymbol("b"));
assertTrue(defs1.hasDefinitionAt("foobar", 1, new String[1]));

// Test that we get null back if we request definitions for a file
// that's not in the repository.
Expand Down
6 changes: 3 additions & 3 deletions web/help.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ A <dfn>Query</dfn> is a series of clauses. A clause may be prefixed by:</p>
e.g. /[mb]an/ - will search for man or for ban;<br>
NOTE: path field search escapes "/" by default, so it only supports
regexps when the search string <u>starts and ends</u> with "/".<br>
More info can be found on <a href="http://lucene.apache.org/core/4_3_1/core/org/apache/lucene/util/automaton/RegExp.html?is-external=true">lucene regexp page</a>.
More info can be found on <a href="http://lucene.apache.org/core/4_5_0/core/org/apache/lucene/util/automaton/RegExp.html?is-external=true">lucene regexp page</a>.
</li>
<li>to perform a single character wildcard search use the "<b>?</b>" symbol,
e.g. te?t</li>
Expand Down Expand Up @@ -173,7 +173,7 @@ So searching for <b>\+1</b> or <b>\+ 1</b> will both find <b>+1</b> and <b>+ 1</
<dd>Only finds symbols (e.g. methods, classes, functions, variables).</dd>

<dt>path</dt>
<dd>path of the source file (no need to use dividers).</dd>
<dd>path of the source file (no need to use dividers, or if, then use "/" - Windows users, "\" is an escape key in lucene query syntax! Please don't use "\", or replace it with "/".).</dd>

<dt>hist</dt>
<dd>History log comments.</dd>
Expand All @@ -189,7 +189,7 @@ the term (phrases) can be boosted (making it more relevant) using a caret
</p>

<p>Opengrok search is powered by <a href="http://lucene.apache.org/"
>lucene</a>, for more detail on query syntax refer to <a href="http://lucene.apache.org/core/4_3_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package_description">lucene docs</a>.<br>
>lucene</a>, for more detail on query syntax refer to <a href="http://lucene.apache.org/core/4_5_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package_description">lucene docs</a>.<br>
</p>
</div>
<%
Expand Down