Skip to content

Commit b827320

Browse files
committed
Merge remote-tracking branch 'upstream/master' into add-dockerfile2
2 parents d3eb53a + 534a13d commit b827320

File tree

36 files changed

+634
-358
lines changed

36 files changed

+634
-358
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/nbproject/configs/*.properties
44
tags
55
TAGS
6+
!opengrok-web/src/main/webapp/WEB-INF/tags
67
build
78
dist
89
coverage
@@ -52,3 +53,10 @@ pmd.bat
5253
*.pyc
5354
.wercker
5455
.DS_Store
56+
.project
57+
.settings/
58+
.vscode/
59+
*/bin/
60+
.classpath
61+
.checkstyle
62+

.travis.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ addons:
2222
jobs:
2323
include:
2424
- stage: test
25-
name: Linux + Oracle JDK 8
25+
name: Linux + OpenJDK 8
2626
os: linux
27-
dist: trusty
27+
dist: xenial
2828
sudo: required
29-
jdk: oraclejdk8
29+
jdk: openjdk8
3030
install: true
3131
script: dev/main
3232
before_install: dev/before_install
3333
before_script: dev/before
3434
- stage: test
3535
name: Linux + Oracle JDK 11
3636
os: linux
37-
dist: trusty
37+
dist: xenial
3838
sudo: required
3939
jdk: oraclejdk11
4040
install: true
@@ -51,6 +51,8 @@ jobs:
5151
before_script: dev/before
5252
- stage: deploy
5353
name: Github Release
54+
dist: xenial
55+
jdk: openjdk8
5456
if: repo = "oracle/opengrok" AND tag IS present
5557
before_install: dev/before_install
5658
install: true
@@ -80,3 +82,10 @@ jobs:
8082
if: repo = "oracle/opengrok" AND tag IS present
8183
script: dev/post-deploy.sh
8284
install: true
85+
- stage: javadoc
86+
name: Upload javadocs to Github pages
87+
os: linux
88+
dist: xenial
89+
jdk: openjdk8
90+
script: dev/javadoc.sh
91+
install: true

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ environment:
44
MAVEN_VERSION: 3.6.0
55
matrix:
66
- JAVA_HOME: C:\Program Files\Java\jdk1.8.0
7-
PYTHON: C:\Python34
7+
PYTHON: C:\Python35
88
install:
99
- ps: |
1010
Add-Type -AssemblyName System.IO.Compression.FileSystem

dev/before_install

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,20 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
77
exit 1
88
fi
99

10-
sudo apt-get install -qq cvs git mercurial cssc bzr subversion monotone rcs rcs-blame python3 python3.4-venv python3-pip nodejs
10+
sudo apt-get install -qq \
11+
cvs \
12+
git \
13+
mercurial \
14+
cssc \
15+
bzr \
16+
subversion \
17+
monotone \
18+
rcs \
19+
rcs-blame \
20+
python3 \
21+
python3-venv \
22+
python3-pip \
23+
nodejs
1124
if [[ $? != 0 ]]; then
1225
echo "cannot install extra packages"
1326
exit 1

dev/javadoc.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
if [[ "${TRAVIS_REPO_SLUG}" != "oracle/opengrok" ||
7+
"${TRAVIS_PULL_REQUEST}" != "false" ||
8+
"${TRAVIS_BRANCH}" != "master" ]]; then
9+
exit 0
10+
fi
11+
12+
echo -e "Publishing javadoc...\n"
13+
14+
mvn -DskipTests=true site
15+
16+
git config --global user.email "[email protected]"
17+
git config --global user.name "travis-ci"
18+
git clone --quiet --branch=gh-pages \
19+
https://${GH_PAGES_TOKEN}@github.com/oracle/opengrok gh-pages
20+
21+
cd gh-pages
22+
if [[ -d ./javadoc ]]; then
23+
git rm -rf ./javadoc
24+
fi
25+
cp -Rf ${TRAVIS_BUILD_DIR}/target/site/apidocs ./javadoc
26+
git add -f ./javadoc
27+
git commit -m "Lastest javadoc auto-pushed to gh-pages"
28+
git push -fq origin gh-pages
29+
30+
echo -e "Published Javadoc to gh-pages.\n"

distribution/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.opengrok</groupId>
99
<artifactId>opengrok-top</artifactId>
10-
<version>1.2.8</version>
10+
<version>1.2.16</version>
1111
</parent>
1212

1313
<artifactId>opengrok-dist</artifactId>
@@ -24,20 +24,20 @@
2424
<dependency>
2525
<groupId>org.opengrok</groupId>
2626
<artifactId>opengrok</artifactId>
27-
<version>1.2.8</version>
27+
<version>1.2.16</version>
2828
</dependency>
2929

3030
<dependency>
3131
<groupId>org.opengrok</groupId>
3232
<artifactId>opengrok-web</artifactId>
33-
<version>1.2.8</version>
33+
<version>1.2.16</version>
3434
<type>war</type>
3535
</dependency>
3636

3737
<dependency>
3838
<groupId>org.opengrok</groupId>
3939
<artifactId>opengrok-tools</artifactId>
40-
<version>1.2.8</version>
40+
<version>1.2.16</version>
4141
<type>pom</type>
4242
</dependency>
4343
</dependencies>

opengrok-indexer/pom.xml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
2828
<parent>
2929
<groupId>org.opengrok</groupId>
3030
<artifactId>opengrok-top</artifactId>
31-
<version>1.2.8</version>
31+
<version>1.2.16</version>
3232
</parent>
3333

3434
<artifactId>opengrok</artifactId>
35-
<version>1.2.8</version>
35+
<version>1.2.16</version>
3636
<packaging>jar</packaging>
3737

3838
<name>OpenGrok Indexer</name>
@@ -112,8 +112,13 @@ Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
112112
<version>${jersey.version}</version>
113113
</dependency>
114114
<dependency>
115-
<groupId>junit</groupId>
116-
<artifactId>junit</artifactId>
115+
<groupId>org.junit.jupiter</groupId>
116+
<artifactId>junit-jupiter-engine</artifactId>
117+
<scope>test</scope>
118+
</dependency>
119+
<dependency>
120+
<groupId>org.junit.vintage</groupId>
121+
<artifactId>junit-vintage-engine</artifactId>
117122
<scope>test</scope>
118123
</dependency>
119124
<dependency> <!-- TODO: remove! (moving Messages to web module) -->
@@ -210,6 +215,7 @@ Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
210215
<includeOnlyProperties>
211216
<includeOnlyProperty>^git.commit.id</includeOnlyProperty>
212217
</includeOnlyProperties>
218+
<failOnNoGitDirectory>false</failOnNoGitDirectory>
213219
</configuration>
214220
<executions>
215221
<execution>

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/Ctags.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ private void addScalaSupport(List<String> command) {
329329
command.add("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private|protected)?[[:space:]]*case object[[:space:]]+([a-zA-Z0-9_]+)/\\4/O,case objects/");
330330
command.add("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private|protected)?[[:space:]]*trait[[:space:]]+([a-zA-Z0-9_]+)/\\4/t,traits/");
331331
command.add("--regex-scala=/^[[:space:]]*type[[:space:]]+([a-zA-Z0-9_]+)/\\1/T,types/");
332-
command.add("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*def[[:space:]]+([a-zA-Z0-9_]+)/\\3/m,methods/");
332+
command.add("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy|private|protected)[[:space:]]*)*def[[:space:]]+([a-zA-Z0-9_]+)/\\3/m,methods/");
333333
command.add("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*val[[:space:]]+([a-zA-Z0-9_]+)/\\3/l,constants/");
334334
command.add("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*var[[:space:]]+([a-zA-Z0-9_]+)/\\3/v,variables/");
335335
command.add("--regex-scala=/^[[:space:]]*package[[:space:]]+([a-zA-Z0-9_.]+)/\\1/p,packages/");

opengrok-indexer/src/main/java/org/opengrok/indexer/history/HistoryGuru.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -387,12 +387,13 @@ public Map<String, Date> getLastModifiedTimes(File directory)
387387
* @param files list of files to check if they contain a repository
388388
* @param ignoredNames what files to ignore
389389
* @param recursiveSearch whether to use recursive search
390+
* @param type type of the repository to search for or {@code null}
390391
* @param depth current depth - using global scanningDepth - one can limit
391392
* this to improve scanning performance
392393
* @return collection of added repositories
393394
*/
394395
private Collection<RepositoryInfo> addRepositories(File[] files,
395-
IgnoredNames ignoredNames, boolean recursiveSearch, int depth) {
396+
IgnoredNames ignoredNames, boolean recursiveSearch, String type, int depth) {
396397

397398
List<RepositoryInfo> repoList = new ArrayList<>();
398399

@@ -407,13 +408,16 @@ private Collection<RepositoryInfo> addRepositories(File[] files,
407408

408409
Repository repository = null;
409410
try {
410-
repository = RepositoryFactory.getRepository(file);
411+
repository = RepositoryFactory.getRepository(file, type);
411412
} catch (InstantiationException | NoSuchMethodException | InvocationTargetException e) {
412413
LOGGER.log(Level.WARNING, "Could not create repository for '"
413414
+ file + "', could not instantiate the repository.", e);
414415
} catch (IllegalAccessException iae) {
415416
LOGGER.log(Level.WARNING, "Could not create repository for '"
416417
+ file + "', missing access rights.", iae);
418+
} catch (ForbiddenSymlinkException e) {
419+
LOGGER.log(Level.WARNING, "Could not create repository for '"
420+
+ file + "', path traversal issues.", e);
417421
}
418422
if (repository == null) {
419423
// Not a repository, search its sub-dirs.
@@ -426,7 +430,7 @@ private Collection<RepositoryInfo> addRepositories(File[] files,
426430
file.getAbsolutePath());
427431
} else if (depth <= scanningDepth) {
428432
repoList.addAll(HistoryGuru.this.addRepositories(subFiles, ignoredNames,
429-
recursiveSearch, depth + 1));
433+
recursiveSearch, null,depth + 1));
430434
}
431435
}
432436
} else {
@@ -436,18 +440,16 @@ private Collection<RepositoryInfo> addRepositories(File[] files,
436440
repoList.add(new RepositoryInfo(repository));
437441
putRepository(repository);
438442

439-
// @TODO: Search only for one type of repository - the one found here
440443
if (recursiveSearch && repository.supportsSubRepositories()) {
441444
File[] subFiles = file.listFiles();
442445
if (subFiles == null) {
443446
LOGGER.log(Level.WARNING,
444447
"Failed to get sub directories for ''{0}'', check access permissions.",
445448
file.getAbsolutePath());
446449
} else if (depth <= scanningDepth) {
447-
// Search only one level down - if not: too much
448-
// stat'ing for huge Mercurial repositories
450+
// Search only for one type of repository - the one found here.
449451
repoList.addAll(HistoryGuru.this.addRepositories(subFiles, ignoredNames,
450-
false, depth + 1));
452+
false, repository.getType(), depth + 1));
451453
}
452454
}
453455
}
@@ -466,7 +468,7 @@ private Collection<RepositoryInfo> addRepositories(File[] files,
466468
addRepositories(File[] files, Collection<RepositoryInfo> repos,
467469
IgnoredNames ignoredNames, int depth) {
468470

469-
return HistoryGuru.this.addRepositories(files, ignoredNames, true, depth);
471+
return HistoryGuru.this.addRepositories(files, ignoredNames, true, null, depth);
470472
}
471473

472474
/**
@@ -480,7 +482,7 @@ private Collection<RepositoryInfo> addRepositories(File[] files,
480482
public Collection<RepositoryInfo> addRepositories(File[] files,
481483
IgnoredNames ignoredNames) {
482484

483-
return HistoryGuru.this.addRepositories(files, ignoredNames, true, 0);
485+
return HistoryGuru.this.addRepositories(files, ignoredNames, true, null,0);
484486
}
485487

486488
/**

opengrok-indexer/src/main/java/org/opengrok/indexer/history/PerforceRepository.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,24 @@ static String getRevisionCmd(String first, String last) {
272272

273273
@Override
274274
String determineCurrentVersion(boolean interactive) throws IOException {
275-
return null;
275+
File directory = new File(getDirectoryName());
276+
List<String> cmd = new ArrayList<>();
277+
278+
ensureCommand(CMD_PROPERTY_KEY, CMD_FALLBACK);
279+
cmd.add(RepoCommand);
280+
cmd.add("changes");
281+
cmd.add("-t");
282+
cmd.add("-m");
283+
cmd.add("1");
284+
cmd.add("...#have");
285+
286+
Executor executor = new Executor(cmd, directory, interactive ?
287+
RuntimeEnvironment.getInstance().getInteractiveCommandTimeout() :
288+
RuntimeEnvironment.getInstance().getCommandTimeout());
289+
if (executor.exec(false) != 0) {
290+
throw new IOException(executor.getErrorString());
291+
}
292+
293+
return executor.getOutputString().trim();
276294
}
277295
}

0 commit comments

Comments
 (0)