diff --git a/build.gradle b/build.gradle index b06a233bf5..304d119a21 100644 --- a/build.gradle +++ b/build.gradle @@ -13,13 +13,15 @@ plugins { id 'jacoco' id 'application' id 'com.palantir.git-version' version '0.5.1' - id 'com.github.johnrengelman.shadow' version '5.1.0' + id 'com.github.johnrengelman.shadow' version '8.1.1' id "com.github.kt3k.coveralls" version '2.6.3' id "org.ajoberstar.grgit" version "5.2.0" id "org.ajoberstar.git-publish" version "2.1.1" } -mainClassName = "picard.cmdline.PicardCommandLine" +application { + mainClass = "picard.cmdline.PicardCommandLine" +} repositories { mavenCentral() @@ -62,7 +64,7 @@ dependencies { implementation('com.intel.gkl:gkl:0.8.8') { exclude module: 'htsjdk' } - implementation 'com.google.guava:guava:15.0' + implementation 'com.google.guava:guava:32.1.1-jre' implementation 'org.apache.commons:commons-math3:3.5' implementation 'org.apache.commons:commons-collections4:4.3' implementation 'com.github.samtools:htsjdk:' + htsjdkVersion @@ -71,7 +73,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-core:2.17.1' implementation 'org.openjdk.nashorn:nashorn-core:15.4' implementation 'org.apache.commons:commons-lang3:3.6' - implementation 'com.google.cloud:google-cloud-nio:0.123.25' + implementation 'com.google.cloud:google-cloud-nio:0.127.0' testImplementation 'org.testng:testng:6.14.3' } @@ -83,8 +85,10 @@ configurations.all { } } -sourceCompatibility = 1.17 -targetCompatibility = 1.17 +java { + sourceCompatibility = 1.17 + targetCompatibility = 1.17 +} final isRelease = Boolean.getBoolean("release") final gitVersion = gitVersion().replaceAll(".dirty", "") @@ -95,6 +99,22 @@ group = 'com.github.broadinstitute' defaultTasks 'all' +distZip { + dependsOn 'currentJar' +} + +distTar { + dependsOn 'currentJar' +} + +startScripts { + dependsOn 'currentJar' +} + +startShadowScripts { + dependsOn 'currentJar' +} + task all(dependsOn: ['jar', 'distZip', 'javadoc', 'shadowJar', 'currentJar', 'picardDoc']) // Source file names for the picard command line properties file. We select and include only one of @@ -161,6 +181,10 @@ task picardDoc(type: Javadoc, dependsOn: ['cleanPicardDoc', classes]) { options.addStringOption("absolute-version", getVersion()) options.addStringOption("build-timestamp", new Date().format("dd-mm-yyyy hh:mm:ss")) options.addStringOption("verbose") + // Avoid 'javadoc: error - invalid flag: -notimestamp'. See: + // - https://github.com/gradle/gradle/issues/11898 + // - https://github.com/gradle/gradle/issues/11898#issuecomment-993789034 + options.noTimestamp(false) } task currentJar(type: Copy){ @@ -263,13 +287,13 @@ jacocoTestReport { getAdditionalSourceDirs().from(sourceSets.main.allJava.srcDirs) reports { - xml.enabled = true // coveralls plugin depends on xml format report - html.enabled = true + xml.required = true // coveralls plugin depends on xml format report + html.required = true } } wrapper { - gradleVersion = '7.5.1' + gradleVersion = '8.2.1' } task javadocJar(type: Jar) { @@ -362,7 +386,7 @@ publish { ext.htmlDir = file("build/docs/html") //update static web docs -task copyJavadoc(dependsOn: 'javadoc', type: Copy) { +task copyJavadoc(dependsOn: ['javadoc', 'picardDoc'], type: Copy) { from 'build/docs/javadoc' into "$htmlDir/javadoc" } @@ -388,3 +412,7 @@ gitPublish { } } } + +gitPublishCopy { + dependsOn 'updateGhPages', 'copyJavadoc', 'copyPicardDoc' +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 41d9927a4d..249e5832f0 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ae04661ee7..84a0b92f9a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c787337..a69d9cb6c2 100755 --- a/gradlew +++ b/gradlew @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/src/test/java/picard/nio/GATKBucketUtilsTest.java b/src/test/java/picard/nio/GATKBucketUtilsTest.java new file mode 100644 index 0000000000..2f37191cea --- /dev/null +++ b/src/test/java/picard/nio/GATKBucketUtilsTest.java @@ -0,0 +1,29 @@ +package picard.nio; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import org.testng.Assert; + +import java.net.URI; +import java.nio.file.Path; +import java.nio.file.Paths; + +public class GATKBucketUtilsTest { + + @DataProvider + public Object[][] getVariousPathsForPrefetching(){ + return new Object[][]{ + {"file:///local/file", false}, + {"gs://abucket/bucket", true}, + {"gs://abucket_with_underscores", true}, + }; + } + + @Test(groups="bucket", dataProvider = "getVariousPathsForPrefetching") + public void testIsEligibleForPrefetching(String path, boolean isPrefetchable){ + final URI uri = URI.create(path); + final Path uriPath = Paths.get(uri); + Assert.assertEquals(GATKBucketUtils.isEligibleForPrefetching(uriPath), isPrefetchable); + } +}