Upload jars to bintray as part of releases (#1608)

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Adrian Sutton 5 years ago committed by GitHub
parent c95c74af1d
commit 6429311086
  1. 103
      build.gradle

@ -64,6 +64,24 @@ def _strListCmdArg(name) {
return _strListCmdArg(name, null)
}
apply plugin: 'com.jfrog.bintray'
def bintrayUser = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
def bintrayKey = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY')
def bintrayPackage = bintray.pkg {
repo = 'pegasys-repo'
name = 'pantheon'
userOrg = 'consensys'
licenses = ['Apache-2.0']
websiteUrl = 'https://github.com/PegaSysEng/pantheon'
issueTrackerUrl = 'https://github.com/PegaSysEng/pantheon/issues'
vcsUrl = 'https://github.com/PegaSysEng/pantheon.git'
version {
name = project.version
released = new Date()
}
}
allprojects {
apply plugin: 'java-library'
@ -82,6 +100,16 @@ allprojects {
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
@ -249,6 +277,54 @@ task deploy() {}
subprojects {
if (file('src/main/java').directory) {
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
publishing {
publications {
mavenJava(MavenPublication) {
groupId "tech.pegasys.pantheon.internal"
version "${project.version}"
from components.java
artifact sourcesJar
artifact javadocJar
versionMapping {
usage('java-api') { fromResolutionOf('runtimeClasspath') }
usage('java-runtime') { fromResolutionResult() }
}
pom {
name = "Pantheon - ${project.name}"
url = 'http://github.com/PegaSysEng/pantheon'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
connection = 'scm:git:git://github.com/PegaSysEng/pantheon.git'
developerConnection = 'scm:git:ssh://github.com/PegaSysEng/pantheon.git'
url = 'https://github.com/PegaSysEng/pantheon'
}
}
}
}
}
bintray {
user = bintrayUser
key = bintrayKey
publications = ['mavenJava']
override = version.endsWith('SNAPSHOT')
publish = true
pkg = bintrayPackage
}
}
tasks.withType(Test) {
// If GRADLE_MAX_TEST_FORKS is not set, use half the available processors
maxParallelForks = (System.getenv('GRADLE_MAX_TEST_FORKS') ?: (Runtime.runtime.availableProcessors().intdiv(2) ?: 1)).toInteger()
@ -258,7 +334,6 @@ subprojects {
options.fork = true
options.incremental = true
}
apply plugin: 'maven-publish'
sourceSets {
// test-support can be consumed as a library by other projects in their tests
@ -343,7 +418,9 @@ applicationDefaultJvmArgs = [
run {
args project.hasProperty("pantheon.run.args") ? project.property("pantheon.run.args").toString().split("\\s+") : []
doFirst {
applicationDefaultJvmArgs = applicationDefaultJvmArgs.collect{it.replace('PANTHEON_HOME', "$buildDir/pantheon")}
applicationDefaultJvmArgs = applicationDefaultJvmArgs.collect {
it.replace('PANTHEON_HOME', "$buildDir/pantheon")
}
}
}
@ -533,11 +610,9 @@ release {
}
}
apply plugin: 'com.jfrog.bintray'
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY')
user = bintrayUser
key = bintrayKey
filesSpec {
from distTar.destinationDir.path
@ -546,21 +621,9 @@ bintray {
}
publish = true
override = version.endsWith('SNAPSHOT')
pkg {
repo = 'pegasys-repo'
name = 'pantheon'
userOrg = 'consensys'
licenses = ['Apache-2.0']
websiteUrl = 'https://github.com/PegaSysEng/pantheon'
issueTrackerUrl = 'https://github.com/PegaSysEng/pantheon/issues'
vcsUrl = 'https://github.com/PegaSysEng/pantheon.git'
version {
name = project.version
released = new Date()
}
}
pkg = bintrayPackage
}
afterReleaseBuild.dependsOn bintrayUpload

Loading…
Cancel
Save