Loading .travis.yml +14 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,20 @@ cache: jdk: - oraclejdk8 - openjdk8 script: ./gradlew test jacocoTestReport; matrix: fast_finish: true allow_failures: - env: TEST_TYPE=FTP include: - jdk: oraclejdk8 env: TEST_TYPE=FTP script: - if [[ $TEST_TYPE == "FTP" ]]; then ./gradlew testFTP jacocoTestReport; else ./gradlew test jacocoTestReport; fi after_success: - bash <(curl -s https://codecov.io/bash) - echo "TRAVIS_BRANCH='$TRAVIS_BRANCH'"; Loading build.gradle +21 −11 Original line number Diff line number Diff line Loading @@ -10,9 +10,9 @@ plugins { id 'maven' id 'signing' id 'jacoco' id 'com.palantir.git-version' version '0.5.1' id 'com.github.johnrengelman.shadow' version '1.2.3' id 'com.github.maiflai.scalatest' version '0.15' id 'com.palantir.git-version' version '0.11.0' id 'com.github.johnrengelman.shadow' version '2.0.4' id 'com.github.maiflai.scalatest' version '0.22' } repositories { Loading @@ -36,12 +36,12 @@ dependencies { compile "org.xerial.snappy:snappy-java:1.1.4" compile "org.apache.commons:commons-compress:1.4.1" compile "org.tukaani:xz:1.5" compile "gov.nih.nlm.ncbi:ngs-java:1.2.4" compile "gov.nih.nlm.ncbi:ngs-java:2.9.0" testCompile "org.scala-lang:scala-library:2.12.1" testCompile "org.scalatest:scalatest_2.12:3.0.1" testRuntime 'org.pegdown:pegdown:1.4.2' // Necessary for generating HTML reports with ScalaTest testCompile "org.testng:testng:6.9.9" testCompile "org.scala-lang:scala-library:2.12.6" testCompile "org.scalatest:scalatest_2.12:3.0.5" testRuntime 'org.pegdown:pegdown:1.6.0' // Necessary for generating HTML reports with ScalaTest testCompile "org.testng:testng:6.14.3" testCompile "com.google.jimfs:jimfs:1.1" } Loading Loading @@ -100,11 +100,22 @@ test { tags { exclude "slow" exclude "broken" exclude "ftp" if (System.env.CI == "false") exclude "sra" if (!OperatingSystem.current().isUnix()) exclude "unix" } } dependsOn findScalaAndJavaTypes task testFTP(type: Test) { description = "Runs the tests that require connection to a remote ftp server" tags { include "ftp" exclude "slow" exclude "broken" } } task testSRA(type: Test) { description = "Run the SRA tests" jvmArgs += '-Dsamjdk.sra_libraries_download=true' Loading @@ -115,9 +126,8 @@ task testSRA(type: Test) { } } task wrapper(type: Wrapper) { description = "Regenerate the gradle wrapper" gradleVersion = '3.2.1' wrapper { gradleVersion = '4.8.1' } // This is a hack to disable the java 8 default javadoc lint until we fix the html formatting Loading gradle/wrapper/gradle-wrapper.properties +1 −2 Original line number Diff line number Diff line #Fri Jan 20 17:10:11 EST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-all.zip gradlew +13 −10 Original line number Diff line number Diff line #!/usr/bin/env bash #!/usr/bin/env sh ############################################################################## ## Loading Loading @@ -154,16 +154,19 @@ if $cygwin ; then esac fi # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules function splitJvmOpts() { JVM_OPTS=("$@") # Escape application args save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" APP_ARGS=$(save "$@") # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then cd "$(dirname "$0")" fi exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" exec "$JAVACMD" "$@" src/main/java/htsjdk/samtools/BAMFileWriter.java +9 −4 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ import java.nio.file.Path; /** * Concrete implementation of SAMFileWriter for writing gzipped BAM files. */ class BAMFileWriter extends SAMFileWriterImpl { public class BAMFileWriter extends SAMFileWriterImpl { private final BinaryCodec outputBinaryCodec; private BAMRecordCodec bamRecordCodec = null; Loading Loading @@ -78,7 +78,7 @@ class BAMFileWriter extends SAMFileWriterImpl { } protected BAMFileWriter(final OutputStream os, final String absoluteFilename, final int compressionLevel, final DeflaterFactory deflaterFactory) { blockCompressedOutputStream = new BlockCompressedOutputStream(os, null, compressionLevel, deflaterFactory); blockCompressedOutputStream = new BlockCompressedOutputStream(os, (Path)null, compressionLevel, deflaterFactory); outputBinaryCodec = new BinaryCodec(blockCompressedOutputStream); outputBinaryCodec.setOutputFileName(absoluteFilename); } Loading Loading @@ -200,8 +200,13 @@ class BAMFileWriter extends SAMFileWriterImpl { writeHeader(outputBinaryCodec, samFileHeader, headerString); } protected static void writeHeader(final OutputStream outputStream, final SAMFileHeader samFileHeader) { final BlockCompressedOutputStream blockCompressedOutputStream = new BlockCompressedOutputStream(outputStream, null); /** * Write a BAM file header to an output stream in block compressed BAM format. * @param outputStream the stream to write the BAM header to * @param samFileHeader the header to write */ public static void writeHeader(final OutputStream outputStream, final SAMFileHeader samFileHeader) { final BlockCompressedOutputStream blockCompressedOutputStream = new BlockCompressedOutputStream(outputStream, (Path)null); final BinaryCodec outputBinaryCodec = new BinaryCodec(blockCompressedOutputStream); writeHeader(outputBinaryCodec, samFileHeader); try { Loading Loading
.travis.yml +14 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,20 @@ cache: jdk: - oraclejdk8 - openjdk8 script: ./gradlew test jacocoTestReport; matrix: fast_finish: true allow_failures: - env: TEST_TYPE=FTP include: - jdk: oraclejdk8 env: TEST_TYPE=FTP script: - if [[ $TEST_TYPE == "FTP" ]]; then ./gradlew testFTP jacocoTestReport; else ./gradlew test jacocoTestReport; fi after_success: - bash <(curl -s https://codecov.io/bash) - echo "TRAVIS_BRANCH='$TRAVIS_BRANCH'"; Loading
build.gradle +21 −11 Original line number Diff line number Diff line Loading @@ -10,9 +10,9 @@ plugins { id 'maven' id 'signing' id 'jacoco' id 'com.palantir.git-version' version '0.5.1' id 'com.github.johnrengelman.shadow' version '1.2.3' id 'com.github.maiflai.scalatest' version '0.15' id 'com.palantir.git-version' version '0.11.0' id 'com.github.johnrengelman.shadow' version '2.0.4' id 'com.github.maiflai.scalatest' version '0.22' } repositories { Loading @@ -36,12 +36,12 @@ dependencies { compile "org.xerial.snappy:snappy-java:1.1.4" compile "org.apache.commons:commons-compress:1.4.1" compile "org.tukaani:xz:1.5" compile "gov.nih.nlm.ncbi:ngs-java:1.2.4" compile "gov.nih.nlm.ncbi:ngs-java:2.9.0" testCompile "org.scala-lang:scala-library:2.12.1" testCompile "org.scalatest:scalatest_2.12:3.0.1" testRuntime 'org.pegdown:pegdown:1.4.2' // Necessary for generating HTML reports with ScalaTest testCompile "org.testng:testng:6.9.9" testCompile "org.scala-lang:scala-library:2.12.6" testCompile "org.scalatest:scalatest_2.12:3.0.5" testRuntime 'org.pegdown:pegdown:1.6.0' // Necessary for generating HTML reports with ScalaTest testCompile "org.testng:testng:6.14.3" testCompile "com.google.jimfs:jimfs:1.1" } Loading Loading @@ -100,11 +100,22 @@ test { tags { exclude "slow" exclude "broken" exclude "ftp" if (System.env.CI == "false") exclude "sra" if (!OperatingSystem.current().isUnix()) exclude "unix" } } dependsOn findScalaAndJavaTypes task testFTP(type: Test) { description = "Runs the tests that require connection to a remote ftp server" tags { include "ftp" exclude "slow" exclude "broken" } } task testSRA(type: Test) { description = "Run the SRA tests" jvmArgs += '-Dsamjdk.sra_libraries_download=true' Loading @@ -115,9 +126,8 @@ task testSRA(type: Test) { } } task wrapper(type: Wrapper) { description = "Regenerate the gradle wrapper" gradleVersion = '3.2.1' wrapper { gradleVersion = '4.8.1' } // This is a hack to disable the java 8 default javadoc lint until we fix the html formatting Loading
gradle/wrapper/gradle-wrapper.properties +1 −2 Original line number Diff line number Diff line #Fri Jan 20 17:10:11 EST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-all.zip
gradlew +13 −10 Original line number Diff line number Diff line #!/usr/bin/env bash #!/usr/bin/env sh ############################################################################## ## Loading Loading @@ -154,16 +154,19 @@ if $cygwin ; then esac fi # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules function splitJvmOpts() { JVM_OPTS=("$@") # Escape application args save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" APP_ARGS=$(save "$@") # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then cd "$(dirname "$0")" fi exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" exec "$JAVACMD" "$@"
src/main/java/htsjdk/samtools/BAMFileWriter.java +9 −4 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ import java.nio.file.Path; /** * Concrete implementation of SAMFileWriter for writing gzipped BAM files. */ class BAMFileWriter extends SAMFileWriterImpl { public class BAMFileWriter extends SAMFileWriterImpl { private final BinaryCodec outputBinaryCodec; private BAMRecordCodec bamRecordCodec = null; Loading Loading @@ -78,7 +78,7 @@ class BAMFileWriter extends SAMFileWriterImpl { } protected BAMFileWriter(final OutputStream os, final String absoluteFilename, final int compressionLevel, final DeflaterFactory deflaterFactory) { blockCompressedOutputStream = new BlockCompressedOutputStream(os, null, compressionLevel, deflaterFactory); blockCompressedOutputStream = new BlockCompressedOutputStream(os, (Path)null, compressionLevel, deflaterFactory); outputBinaryCodec = new BinaryCodec(blockCompressedOutputStream); outputBinaryCodec.setOutputFileName(absoluteFilename); } Loading Loading @@ -200,8 +200,13 @@ class BAMFileWriter extends SAMFileWriterImpl { writeHeader(outputBinaryCodec, samFileHeader, headerString); } protected static void writeHeader(final OutputStream outputStream, final SAMFileHeader samFileHeader) { final BlockCompressedOutputStream blockCompressedOutputStream = new BlockCompressedOutputStream(outputStream, null); /** * Write a BAM file header to an output stream in block compressed BAM format. * @param outputStream the stream to write the BAM header to * @param samFileHeader the header to write */ public static void writeHeader(final OutputStream outputStream, final SAMFileHeader samFileHeader) { final BlockCompressedOutputStream blockCompressedOutputStream = new BlockCompressedOutputStream(outputStream, (Path)null); final BinaryCodec outputBinaryCodec = new BinaryCodec(blockCompressedOutputStream); writeHeader(outputBinaryCodec, samFileHeader); try { Loading