Skip to content

Commit 712b400

Browse files
committed
Fix CI build scripts that pick flags appropriate to each JDK
1 parent a50feb2 commit 712b400

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ jdk:
99
- oraclejdk10
1010
- oraclejdk11
1111

12-
# Additionally pass -Dgpg.skip to suppress signing instead of trying to provision
13-
# Travis's containers with keys.
14-
install: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dgpg.skip=true -B -V
15-
# Older versions of Javadoc don't recognize the -Xdoclint flag.
12+
# Test each version with an appropriate Java version and flags to disable
13+
# GPG signing so that we don't have to provision Travis with private keys.
1614
script: "$TRAVIS_BUILD_DIR/scripts/build_for_travis.sh"

scripts/build_for_travis.sh

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,33 @@ set -e
44

55
# Invoked from .travis.yml to verify the build.
66

7-
export COMMON_FLAGS="-Dgpg.skip=true -B -V"
7+
# Pass -Dgpg.skip to suppress signing instead of trying to provision
8+
# Travis's containers with keys.
9+
COMMON_FLAGS="-Dgpg.skip=true -B -V"
810

11+
IS_LEGACY=""
912
if echo $TRAVIS_JDK_VERSION | egrep -q 'jdk[67]'; then
10-
# The main library only uses jdk6 incompatible dependencies,
11-
# and older versions of javadoc barf on -Xdoclint flags used
13+
IS_LEGACY=1
14+
# The main library only uses jdk6 compatible dependencies,
15+
# but Guava 21.0 is compatibility with jdk 7.
16+
COMMON_FLAGS="$COMMON_FLAGS -Dguava.version=20.0"
17+
18+
# Older versions of javadoc barf on -Xdoclint flags used
1219
# to configure the maven-javadoc-plugin.
13-
exec mvn verify -Dguava.version=20.0 -Dmaven.javadoc.skip=true $COMMON_FLAGS
20+
COMMON_FLAGS="$COMMON_FLAGS -Dmaven.javadoc.skip=true"
21+
fi
22+
23+
24+
mvn install -DskipTests=true $COMMON_FLAGS
25+
26+
27+
if [ -n "$IS_LEGACY" ]; then
28+
# Don't bother building ancillary JARs and reports.
29+
exec mvn verify -Dmaven.javadoc.skip=true $COMMON_FLAGS
1430
else
1531
# Build the whole kit-n-kaboodle.
1632
mvn -f aggregate/pom.xml source:jar javadoc:jar verify $COMMON_FLAGS \
1733
&& mvn -Dguava.version=27.1-jre -f aggregate/pom.xml clean source:jar javadoc:jar verify $COMMON_FLAGS \
1834
&& mvn jacoco:report coveralls:report \
19-
&& mvn org.sonatype.ossindex.maven:ossindex-maven-plugin:audit -f aggregate
35+
&& mvn org.sonatype.ossindex.maven:ossindex-maven-plugin:audit $COMMON_FLAGS
2036
fi

0 commit comments

Comments
 (0)