Skip to content

Commit 37187cd

Browse files
committed
jdk8 , fix ctag definitions to work on solaris too
1 parent faf2567 commit 37187cd

File tree

8 files changed

+70
-126
lines changed

8 files changed

+70
-126
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: java
22
jdk:
3-
- oraclejdk7
3+
- oraclejdk8
44
before_install:
55
- sudo apt-get update -qq
66
- sudo apt-get install -qq exuberant-ctags cvs git mercurial cssc bzr subversion

README.txt

Lines changed: 13 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ Offical page of the project is on:
3535
2. Requirements
3636
---------------
3737

38-
* Latest Java (At least 1.7, 1.8 is supported)
38+
* Latest Java (At least 1.8)
3939
http://www.oracle.com/technetwork/java/
40-
* A servlet container like Tomcat (7.x or later)
40+
* A servlet container like Tomcat (8.x or later)
4141
supporting Servlet 2.4 and JSP 2.0
4242
http://tomcat.apache.org/
4343
* Exuberant Ctags
@@ -439,7 +439,7 @@ Solaris 11:
439439

440440
Debian/Ubuntu:
441441

442-
# apt-get install sun-java6-javadb
442+
# apt-get install sun-java8-javadb
443443

444444
Other:
445445

@@ -638,13 +638,8 @@ being executed on) under the dist/ directory.
638638
Note: For full coverage report your system has to provide proper junit test
639639
environment, that would mean:
640640

641-
- you have to use Ant 1.7 and above
642-
- at least junit-4.10.jar has to be in ant's classpath (e.g. in ./lib)
643-
- Example install in the top of the opengrok repository:
644-
645-
$ cd lib
646-
$ wget http://.../junit-4.10.jar
647-
$ jar -xf junit-4.10.jar
641+
- you have to use Ant 1.9 and above
642+
- at least junit-4.12.jar has to be in ant's classpath (e.g. in ./lib)
648643

649644
- install derby.jar to ant's classpath so that Java DB tests can be run
650645
- your PATH must contain directory with exuberant ctags binary
@@ -696,53 +691,18 @@ under the lib directory):
696691
There is also a findbugs-xml ant target that can be used to generate XML files
697692
that can later be parsed, e.g. by Jenkins.
698693

699-
9.3 Using Emma
694+
9.3 Using Jacoco
700695
--------------
701696

702-
If you want to check test coverage on OpenGrok, download Emma from
703-
http://emma.sourceforge.net/. Place emma.jar and emma-ant.jar in the
704-
opengrok/trunk/lib directory, or ~/.ant/lib.
705-
706-
Now you can instrument your classes, and create a jar file:
707-
708-
$ ant emma-instrument
709-
710-
If you are using NetBeans, select File - "opengrok" Properties
711-
- libraries - Compile tab. Press the "Add JAR/Folder" and select
712-
lib/emma.jar and lib/emma_ant.jar
713-
714-
If you are not using netbeans, you have to edit the file
715-
nbproject/project.properties, and add "lib/emma.jar" and
716-
"lib/emma_ant.jar" to the javac.classpath inside it.
717-
718-
Now you can put the classes into jars and generate distributable:
719-
720-
$ ant dist
721-
722-
The classes inside opengrok.jar should now be instrumented.
723-
If you use opengrok.jar for your own set of tests, you need
724-
emma.jar in the classpath.If you want to specify where to store
725-
the run time analysis, use these properties:
726-
727-
emma.coverage.out.file=path/coverage.ec
728-
emma.coverage.out.merge=true
729-
730-
The coverage.ec file should be placed in the opengrok/trunk/coverage
731-
directory for easy analyze.
732-
733-
If you want to test the coverage of the unit tests, you can
734-
run the tests:
735-
736-
$ ant test
737-
738-
Alternatively press Alt+F6 in NetBeans to achieve the same.
697+
If you want to check test coverage on OpenGrok, download jacoco from
698+
http://www.eclemma.org/jacoco/. Place jacocoagent.jar and jacocoant.jar in the
699+
opengrok/lib ~/.ant/lib or into classpath (-lib option of ant).
739700

740-
Now you should get some output saying that Emma is placing runtime
741-
coverage data into coverage.ec.
701+
Now you can instrument your classes and test them run:
742702

743-
To generate reports, run ant again:
703+
$ ant -Djacoco=true -Djacoco.home=/<path_to>/jacoco jacoco-code-coverage
744704

745-
$ ant emma-report
705+
Now you should get output data in .
746706

747707
Look at coverage/coverage.txt, coverage/coverage.xml and
748708
coverage/coverage.html to see how complete your tests are.
@@ -857,6 +817,7 @@ e.g. using bash:
857817
9.8 Using Travis CI
858818
-------------------
859819

820+
Travis depends on updated and working maven build.
860821
Please see .travis.yml, if your branch has this file,
861822
you should be able to connect your Github to Travis CI.
862823
OpenGroks Travis is here: https://travis-ci.org/OpenGrok/OpenGrok

build.xml

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -625,32 +625,7 @@ Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
625625
</jacoco:report>
626626
</target>
627627

628-
<target name="-check_emma" description="Check that emma jar files are present">
629-
<available file="emma.jar" type="file" property="emma.jar.present">
630-
<filepath refid="lib.search.path"/>
631-
</available>
632-
<fail unless="emma.jar.present" message="Please install emma.jar in lib-directory (or in ant classpath) to run Emma, see README."/>
633-
634-
<available file="emma_ant.jar" type="file" property="emma_ant.jar.present">
635-
<filepath refid="lib.search.path"/>
636-
</available>
637-
<fail unless="emma_ant.jar.present" message="Please install emma_ant.jar in lib-directory (or in ant classpath) to run Emma, see README."/>
638-
</target>
639-
640-
<target name="emma-instrument" depends="compile, -check_emma" description="Instruments the source code for Emma code coverage analysis">
641-
<taskdef resource="emma_ant.properties"/>
642-
<mkdir dir="${coverage.dir}" />
643-
<emma enabled="true">
644-
<instr instrpath="build/classes"
645-
metadatafile="${coverage.dir}/coverage.em"
646-
mode="overwrite"
647-
filter="+org.opensolaris.*,-org.opensolaris.opengrok.management.client.*"/>
648-
</emma>
649-
</target>
650-
651-
<target name="-pre-compile-test"><!-- depends="-set-jacocoagent"> -->
652-
<property name="test-sys-prop.emma.coverage.out.file" value="${coverage.dir}/coverage.ec"/>
653-
<property name="test-sys-prop.emma.coverage.out.merge" value="true"/>
628+
<target name="-pre-compile-test"><!-- depends="-set-jacocoagent"> -->
654629
</target>
655630

656631
<!-- <target name="-pre-compile-test-single" depends="-set-jacocoagent"/> -->
@@ -791,21 +766,6 @@ Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
791766
<delete file="${test.cvs.repo}/CVS/Root"/>
792767
</target>
793768

794-
<target name="emma-report" description="Analyze" depends="-check_emma">
795-
<taskdef resource="emma_ant.properties"/>
796-
<emma enabled="true" >
797-
<report sourcepath="${src.dir},${src.generatedsrc.dir}">
798-
<!-- collect all EMMA data dumps (metadata and runtime): -->
799-
<infileset dir="${coverage.dir}" includes="*.em, *.ec"/>
800-
<txt outfile="${coverage.dir}/coverage.txt"/>
801-
<xml outfile="${coverage.dir}/coverage.xml"/>
802-
<html outfile="${coverage.dir}/index.html"/>
803-
</report>
804-
</emma>
805-
</target>
806-
807-
<target name="emma-code-coverage" depends="clean, emma-instrument, test, emma-report" description="Make test code coverage reports based on the OpenGrok unit tests"/>
808-
809769
<target name="jdepend" depends="compile" description="Run JDepend dependency checking">
810770
<mkdir dir="jdepend"/>
811771
<java classname="jdepend.xmlui.JDepend" failonerror="true" fork="true">

nbproject/project.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ javac.compilerargs=-Xlint:unchecked
7676
javac.deprecation=true
7777
javac.processorpath=\
7878
${javac.classpath}
79-
javac.source=1.7
80-
javac.target=1.7
79+
javac.source=1.8
80+
javac.target=1.8
8181
javac.test.classpath=\
8282
${javac.classpath}:\
8383
${build.classes.dir}:\
@@ -115,7 +115,7 @@ run.classpath=\
115115
# Space-separated list of JVM arguments used when running the project
116116
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
117117
# or test-sys-prop.name=value to set system properties for unit tests):
118-
run.jvmargs=-XX:-UseSplitVerifier -ea -enableassertions:org.opensolaris.opengrok...
118+
run.jvmargs=-ea -enableassertions:org.opensolaris.opengrok...
119119
#-javaagent:lib/jacocoagent.jar=destfile=jacoco.exec
120120
run.test.classpath=\
121121
${javac.test.classpath}:\

opengrok-web-nbproject/nbproject/project.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ javac.debug=true
7676
javac.deprecation=true
7777
javac.processorpath=\
7878
${javac.classpath}
79-
javac.source=1.7
80-
javac.target=1.7
79+
javac.source=1.8
80+
javac.target=1.8
8181
javac.test.classpath=\
8282
${javac.classpath}:\
8383
${build.classes.dir}:\

platform/solaris/ips/create.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ done
224224
PKG pkgsend add file dist/opengrok.1 mode=0444 owner=root group=bin path=/usr/opengrok/man/man1/opengrok.1
225225

226226
# install default configuration
227-
PKG pkgsend add depend fmri=pkg:/runtime/java/jre-7 type=require
227+
PKG pkgsend add depend fmri=pkg:/runtime/java/jre-8 type=require
228228
PKG pkgsend add depend fmri=pkg:/web/java-servlet/tomcat type=require
229229

230230
# Following line gets commented by that the developer/tool/exuberant-ctags has been removed from IPS

pom.xml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
CDDL HEADER START
5+
6+
The contents of this file are subject to the terms of the
7+
Common Development and Distribution License (the "License").
8+
You may not use this file except in compliance with the License.
9+
10+
See LICENSE.txt included in this distribution for the specific
11+
language governing permissions and limitations under the License.
12+
13+
When distributing Covered Code, include this CDDL HEADER in each
14+
file and include the License file at LICENSE.txt.
15+
If applicable, add the following below this CDDL HEADER, with the
16+
fields enclosed by brackets "[]" replaced with your own identifying
17+
information: Portions Copyright [yyyy] [name of copyright owner]
18+
19+
CDDL HEADER END
20+
21+
Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
22+
23+
-->
224
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
325
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
426
<modelVersion>4.0.0</modelVersion>
@@ -37,8 +59,8 @@
3759
<properties>
3860
<lucene.version>5.0.0</lucene.version>
3961
<mavenjavadocplugin.version>2.9.1</mavenjavadocplugin.version>
40-
<compileSource>1.7</compileSource>
41-
<compileTarget>1.7</compileTarget>
62+
<compileSource>1.8</compileSource>
63+
<compileTarget>1.8</compileTarget>
4264
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4365
</properties>
4466

@@ -127,10 +149,9 @@
127149
<version>2.16</version>
128150
</plugin>
129151
<plugin>
130-
<groupId>org.codehaus.mojo</groupId>
131-
<artifactId>emma-maven-plugin</artifactId>
132-
<version>1.0-alpha-3</version>
133-
<inherited>true</inherited>
152+
<groupId>org.jacoco</groupId>
153+
<artifactId>jacoco-maven-plugin</artifactId>
154+
<version>0.7.4</version>
134155
</plugin>
135156
<plugin>
136157
<groupId>org.apache.maven.plugins</groupId>

src/org/opensolaris/opengrok/analysis/Ctags.java

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -94,29 +94,31 @@ private void initialize() throws IOException {
9494
command.add("--langmap=sql:+.pld"); // RFE #19208
9595
command.add("--langmap=sql:+.pks"); // RFE #19208 ?
9696

97+
//Ideally all below should be in ctags, or in outside config file,
98+
//we might run out of command line SOON
9799
command.add("--langdef=scala"); // below is bug 61 to get full scala support
98100
command.add("--langmap=scala:.scala");
99-
command.add("--regex-scala=/^\\s*((abstract|final|sealed|implicit|lazy)\\s*)*(private|protected)?\\s*class\\s+([a-zA-Z0-9_]+)/\\4/c,classes/");
100-
command.add("--regex-scala=/^\\s*((abstract|final|sealed|implicit|lazy)\\s*)*(private|protected)?\\s*object\\s+([a-zA-Z0-9_]+)/\\4/c,objects/");
101-
command.add("--regex-scala=/^\\s*((abstract|final|sealed|implicit|lazy)\\s*)*(private|protected)?\\s*case class\\s+([a-zA-Z0-9_]+)/\\4/c,case classes/");
102-
command.add("--regex-scala=/^\\s*((abstract|final|sealed|implicit|lazy)\\s*)*(private|protected)?\\s*case object\\s+([a-zA-Z0-9_]+)/\\4/c,case objects/");
103-
command.add("--regex-scala=/^\\s*((abstract|final|sealed|implicit|lazy)\\s*)*(private|protected)?\\s*trait\\s+([a-zA-Z0-9_]+)/\\4/t,traits/");
104-
command.add("--regex-scala=/^\\s*type\\s+([a-zA-Z0-9_]+)/\\1/T,types/");
105-
command.add("--regex-scala=/^\\s*((abstract|final|sealed|implicit|lazy)\\s*)*def\\s+([a-zA-Z0-9_]+)/\\3/m,methods/");
106-
command.add("--regex-scala=/^\\s*((abstract|final|sealed|implicit|lazy)\\s*)*val\\s+([a-zA-Z0-9_]+)/\\3/l,constants/");
107-
command.add("--regex-scala=/^\\s*((abstract|final|sealed|implicit|lazy)\\s*)*var\\s+([a-zA-Z0-9_]+)/\\3/l,variables/");
108-
command.add("--regex-scala=/^\\s*package\\s+([a-zA-Z0-9_.]+)/\\1/p,packages/");
109-
110-
command.add("--langdef=haskell");
101+
command.add("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private|protected)?[[:space:]]*class[[:space:]]+([a-zA-Z0-9_]+)/\\4/c,classes/");
102+
command.add("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private|protected)?[[:space:]]*object[[:space:]]+([a-zA-Z0-9_]+)/\\4/c,objects/");
103+
command.add("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private|protected)?[[:space:]]*case class[[:space:]]+([a-zA-Z0-9_]+)/\\4/c,case classes/");
104+
command.add("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private|protected)?[[:space:]]*case object[[:space:]]+([a-zA-Z0-9_]+)/\\4/c,case objects/");
105+
command.add("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private|protected)?[[:space:]]*trait[[:space:]]+([a-zA-Z0-9_]+)/\\4/t,traits/");
106+
command.add("--regex-scala=/^[[:space:]]*type[[:space:]]+([a-zA-Z0-9_]+)/\\1/T,types/");
107+
command.add("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*def[[:space:]]+([a-zA-Z0-9_]+)/\\3/m,methods/");
108+
command.add("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*val[[:space:]]+([a-zA-Z0-9_]+)/\\3/l,constants/");
109+
command.add("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*var[[:space:]]+([a-zA-Z0-9_]+)/\\3/l,variables/");
110+
command.add("--regex-scala=/^[[:space:]]*package[[:space:]]+([a-zA-Z0-9_.]+)/\\1/p,packages/");
111+
112+
command.add("--langdef=haskell"); // below was added with #912
111113
command.add("--langmap=haskell:.hs.hsc");
112-
command.add("--regex-haskell=/^\\s*class\\s+([a-zA-Z0-9_]+)/\\1/c,classes/");
113-
command.add("--regex-haskell=/^\\s*data\\s+([a-zA-Z0-9_]+)/\\1/t,types/");
114-
command.add("--regex-haskell=/^\\s*newtype\\s+([a-zA-Z0-9_]+)/\\1/t,types/");
115-
command.add("--regex-haskell=/^\\s*type\\s+([a-zA-Z0-9_]+)/\\1/t,types/");
116-
command.add("--regex-haskell=/^([a-zA-Z0-9_]+).*\\s+={1}\\s+/\\1/f,functions/");
117-
command.add("--regex-haskell=/\\s+([a-zA-Z0-9_]+).*\\s+={1}\\s+/\\1/f,functions/");
118-
command.add("--regex-haskell=/^(let|where)\\s+([a-zA-Z0-9_]+).*\\s+={1}\\s+/\\2/f,functions/");
119-
command.add("--regex-haskell=/\\s+(let|where)\\s+([a-zA-Z0-9_]+).*\\s+={1}\\s+/\\2/f,functions/");
114+
command.add("--regex-haskell=/^[[:space:]]*class[[:space:]]+([a-zA-Z0-9_]+)/\\1/c,classes/");
115+
command.add("--regex-haskell=/^[[:space:]]*data[[:space:]]+([a-zA-Z0-9_]+)/\\1/t,types/");
116+
command.add("--regex-haskell=/^[[:space:]]*newtype[[:space:]]+([a-zA-Z0-9_]+)/\\1/t,types/");
117+
command.add("--regex-haskell=/^[[:space:]]*type[[:space:]]+([a-zA-Z0-9_]+)/\\1/t,types/");
118+
command.add("--regex-haskell=/^([a-zA-Z0-9_]+).*[[:space:]]+={1}[[:space:]]+/\\1/f,functions/");
119+
command.add("--regex-haskell=/[[:space:]]+([a-zA-Z0-9_]+).*[[:space:]]+={1}[[:space:]]+/\\1/f,functions/");
120+
command.add("--regex-haskell=/^(let|where)[[:space:]]+([a-zA-Z0-9_]+).*[[:space:]]+={1}[[:space:]]+/\\2/f,functions/");
121+
command.add("--regex-haskell=/[[:space:]]+(let|where)[[:space:]]+([a-zA-Z0-9_]+).*[[:space:]]+={1}[[:space:]]+/\\2/f,functions/");
120122

121123
/* Add extra command line options for ctags. */
122124
if (CTagsExtraOptionsFile != null) {

0 commit comments

Comments
 (0)