-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d02da9
commit 1217308
Showing
1 changed file
with
36 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ buildscript { | |
plugins { | ||
id 'java' | ||
id 'scala' | ||
id 'maven' | ||
id 'maven-publish' | ||
id 'signing' | ||
id 'jacoco' | ||
id 'com.palantir.git-version' version '0.11.0' | ||
|
@@ -22,7 +22,6 @@ repositories { | |
jacocoTestReport { | ||
group = "Reporting" | ||
description = "Generate Jacoco coverage reports after running tests." | ||
getAdditionalSourceDirs().from(sourceSets.main.allJava.srcDirs) | ||
|
||
reports { | ||
xml.enabled = true // codecov depends on xml format report | ||
|
@@ -58,6 +57,8 @@ group = 'com.github.samtools' | |
|
||
defaultTasks 'jar' | ||
|
||
|
||
|
||
jar { | ||
manifest { | ||
attributes 'Implementation-Title': 'HTSJDK', | ||
|
@@ -145,72 +146,62 @@ task sourcesJar(type: Jar) { | |
archiveClassifier.set('sources') | ||
} | ||
|
||
/** | ||
*This specifies what artifacts will be built and uploaded when performing a maven upload. | ||
*/ | ||
artifacts { | ||
archives jar | ||
archives javadocJar | ||
archives sourcesJar | ||
} | ||
|
||
/** | ||
* Sign non-snapshot releases with our secret key. This should never need to be invoked directly. | ||
*/ | ||
signing { | ||
required { isRelease && gradle.taskGraph.hasTask("uploadArchives") } | ||
required { isRelease && gradle.taskGraph.hasTask("publishHtsjdkPublicationToMavenRepository") } | ||
sign configurations.archives | ||
} | ||
|
||
/** | ||
* Upload a release to sonatype. You must be an authorized uploader and have your sonatype | ||
* username and password information in your gradle properties file. See the readme for more info. | ||
* | ||
* For releasing to your local maven repo, use gradle install | ||
*/ | ||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { | ||
authentication(userName: project.findProperty("sonatypeUsername"), password: project.findProperty("sonatypePassword")) | ||
} | ||
publishing { | ||
publications { | ||
htsjdk(MavenPublication) { | ||
from components.java | ||
artifact javadocJar | ||
artifact sourcesJar | ||
|
||
snapshotRepository(url: "https://broadinstitute.jfrog.io/broadinstitute/libs-snapshot-local/") { | ||
authentication(userName: System.env.ARTIFACTORY_USERNAME, password: System.env.ARTIFACTORY_PASSWORD) | ||
} | ||
|
||
pom.project { | ||
name 'HTSJDK' | ||
packaging 'jar' | ||
description 'A Java API for high-throughput sequencing data (HTS) formats' | ||
url 'http://samtools.github.io/htsjdk/' | ||
pom { | ||
name = 'HTSJDK' | ||
packaging = 'jar' | ||
description = 'A Java API for high-throughput sequencing data (HTS) formats' | ||
url = 'http://samtools.github.io/htsjdk/' | ||
|
||
developers { | ||
developer { | ||
id 'picard' | ||
name 'Picard Team' | ||
url 'http://broadinstitute.github.io/picard' | ||
id = 'picard' | ||
name = 'Picard Team' | ||
url = 'http://broadinstitute.github.io/picard' | ||
} | ||
} | ||
|
||
scm { | ||
url '[email protected]:samtools/htsjdk.git' | ||
connection 'scm:git:[email protected]:samtools/htsjdk.git' | ||
url = '[email protected]:samtools/htsjdk.git' | ||
connection = 'scm:git:[email protected]:samtools/htsjdk.git' | ||
} | ||
|
||
licenses { | ||
license { | ||
name 'MIT License' | ||
url 'http://opensource.org/licenses/MIT' | ||
distribution 'repo' | ||
name = 'MIT License' | ||
url = 'http://opensource.org/licenses/MIT' | ||
distribution = 'repo' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
doFirst{ | ||
System.out.println("Uploading version $version") | ||
|
||
repositories { | ||
maven { | ||
credentials { | ||
username = isRelease ? project.findProperty("sonatypeUsername") : System.env.ARTIFACTORY_USERNAME | ||
password = isRelease ? project.findProperty("sonatypePassword") : System.env.ARTIFACTORY_PASSWORD | ||
} | ||
def release = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
def snapshot = "https://broadinstitute.jfrog.io/broadinstitute/libs-snapshot-local/" | ||
url = isRelease ? release : snapshot | ||
} | ||
} | ||
} | ||
|
||
task install(dependsOn:publishToMavenLocal) |