Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on Java 11 #106

Merged
merged 4 commits into from
Jul 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
language: java
sudo: required
jdk:
- oraclejdk8
- openjdk8
matrix:
include:
- jdk: oraclejdk8
env: JAVA_RELEASE=8 JAVA_VERSION=1.8 SCALA_VERSION=2.11
- jdk: openjdk8
env: JAVA_RELEASE=8 JAVA_VERSION=1.8 SCALA_VERSION=2.11
- jdk: openjdk11
env: JAVA_RELEASE=11 JAVA_VERSION=11 SCALA_VERSION=2.12
env:
- NO_GCE_CHECK=true
global:
- NO_GCE_CHECK=true
script:
- mvn -B verify -Ddisq.test.real.world.files.dir=$TRAVIS_BUILD_DIR/gatk/src/test/resources/large -Ddisq.test.real.world.files.ref=$TRAVIS_BUILD_DIR/gatk/src/test/resources/large/human_g1k_v37.20.21.fasta -Ddisq.samtools.bin=/usr/bin/samtools -Ddisq.bcftools.bin=/usr/bin/bcftools
- mvn -B verify -Djava.release=$JAVA_RELEASE -Djava.version=$JAVA_VERSION -Dscala.version=$SCALA_VERSION -Ddisq.test.real.world.files.dir=$TRAVIS_BUILD_DIR/gatk/src/test/resources/large -Ddisq.test.real.world.files.ref=$TRAVIS_BUILD_DIR/gatk/src/test/resources/large/human_g1k_v37.20.21.fasta -Ddisq.samtools.bin=/usr/bin/samtools -Ddisq.bcftools.bin=/usr/bin/bcftools
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate that it's sometimes 1.8 and sometimes 8, but what can you do...

cache:
directories:
- $HOME/.m2
Expand Down
31 changes: 28 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@
</developers>

<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<java.release>8</java.release>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that if you specify a property on the command line it automatically overrules the one that's included in the file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right

<java.version>1.8</java.version>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${java.version}</maven.compiler.source>
<htsjdk.version>2.19.0</htsjdk.version>
<hadoop.version>2.7.5</hadoop.version>
<mockito.version>2.22.0</mockito.version>
<kryo-serializers.version>0.42</kryo-serializers.version>
<slf4j.version>1.7.25</slf4j.version>
<scala.version>2.11</scala.version>
<spark.version>2.3.2</spark.version>
<spark.version>2.4.3</spark.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -161,6 +163,11 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
Expand Down Expand Up @@ -338,6 +345,24 @@
</distributionManagement>

<profiles>
<profile>
<id>java11</id>
<activation>
<jdk>11</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dumb maven question: why do we need a java11 profile? to specify a different compiler plugin?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's to set the maven-compiler-plugin's release configuration property. Annoyingly this is not recognized by the Java 8 compiler, so it can only be set in the Java 11 configuration. Using a profile was the only way I could see to do this.

<version>3.8.0</version>
<configuration>
<release>${java.release}</release>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release</id>
<build>
Expand Down
15 changes: 15 additions & 0 deletions src/build/conf/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<Match>
<!-- Java 11 false positive -->
<!-- https://github.com/spotbugs/spotbugs/issues/756 -->
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" />
</Match>
<Match>
<!-- Java 11 false positive -->
<!-- https://github.com/spotbugs/spotbugs/issues/756 -->
<Or>
<Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE" />
</Or>
<Class name="org.disq_bio.disq.impl.formats.cram.CramSource"/>
</Match>
<Match>
<Class name="org.disq_bio.disq.impl.file.SeekableByteChannelPrefetcher"/>
</Match>
Expand Down