mirror of
https://github.com/corda/corda.git
synced 2025-01-11 23:43:03 +00:00
Bintray configuration block now contains all fields required for the bare minimum POM.
This commit is contained in:
parent
6ac7b9384d
commit
4b2d786724
@ -34,9 +34,21 @@ bintrayConfig {
|
|||||||
repo = 'corda'
|
repo = 'corda'
|
||||||
org = 'r3'
|
org = 'r3'
|
||||||
licenses = ['Apache-2.0']
|
licenses = ['Apache-2.0']
|
||||||
|
vcsUrl = 'https://github.com/corda/corda'
|
||||||
|
projectUrl = 'https://github.com/corda/corda'
|
||||||
gpgSign = true
|
gpgSign = true
|
||||||
gpgPassphrase = System.getenv('CORDA_BINTRAY_GPG_PASSPHRASE')
|
gpgPassphrase = System.getenv('CORDA_BINTRAY_GPG_PASSPHRASE')
|
||||||
publications = ['cordformation', 'quasar-utils']
|
publications = ['cordformation', 'quasar-utils']
|
||||||
|
license {
|
||||||
|
name = 'Apache-2.0'
|
||||||
|
url = 'https://www.apache.org/licenses/LICENSE-2.0'
|
||||||
|
distribution = 'repo'
|
||||||
|
}
|
||||||
|
developer {
|
||||||
|
id = 'R3'
|
||||||
|
name = 'R3'
|
||||||
|
email = 'dev@corda.net'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Aliasing the publishToMavenLocal for simplicity.
|
// Aliasing the publishToMavenLocal for simplicity.
|
||||||
|
@ -6,6 +6,7 @@ import org.gradle.api.tasks.javadoc.Javadoc
|
|||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.publish.maven.MavenPublication
|
import org.gradle.api.publish.maven.MavenPublication
|
||||||
import org.gradle.api.publish.maven.MavenPom
|
import org.gradle.api.publish.maven.MavenPom
|
||||||
|
import net.corda.plugins.bintray.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A utility plugin that when applied will automatically create source and javadoc publishing tasks
|
* A utility plugin that when applied will automatically create source and javadoc publishing tasks
|
||||||
@ -24,10 +25,9 @@ class PublishTasks implements Plugin<Project> {
|
|||||||
createTasks()
|
createTasks()
|
||||||
createExtensions()
|
createExtensions()
|
||||||
|
|
||||||
def bintrayConfig = project.rootProject.extensions.findByName('bintrayConfig')
|
def bintrayConfig = project.rootProject.extensions.findByType(BintrayConfigExtension.class)
|
||||||
if((bintrayConfig != null) && (bintrayConfig.publications)) {
|
if((bintrayConfig != null) && (bintrayConfig.publications)) {
|
||||||
def publications = bintrayConfig.publications.findAll { it == project.name }
|
def publications = bintrayConfig.publications.findAll { it == project.name }
|
||||||
println("HI")
|
|
||||||
if(publications.size > 0) {
|
if(publications.size > 0) {
|
||||||
project.logger.info("Configuring bintray for ${project.name}")
|
project.logger.info("Configuring bintray for ${project.name}")
|
||||||
project.configure(project) {
|
project.configure(project) {
|
||||||
@ -43,44 +43,44 @@ class PublishTasks implements Plugin<Project> {
|
|||||||
artifact project.tasks.sourceJar
|
artifact project.tasks.sourceJar
|
||||||
artifact project.tasks.javadocJar
|
artifact project.tasks.javadocJar
|
||||||
|
|
||||||
extendPomForMavenCentral(pom)
|
extendPomForMavenCentral(pom, bintrayConfig)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Maven central requires all of the below fields for this to be a valid POM
|
// Maven central requires all of the below fields for this to be a valid POM
|
||||||
void extendPomForMavenCentral(MavenPom pom) {
|
void extendPomForMavenCentral(MavenPom pom, BintrayConfigExtension config) {
|
||||||
pom.withXml {
|
pom.withXml {
|
||||||
asNode().children().last() + {
|
asNode().children().last() + {
|
||||||
resolveStrategy = Closure.DELEGATE_FIRST
|
resolveStrategy = Closure.DELEGATE_FIRST
|
||||||
name project.name
|
name project.name
|
||||||
description project.description
|
description project.description
|
||||||
url 'https://github.com/corda/corda'
|
url config.projectUrl
|
||||||
scm {
|
scm {
|
||||||
url 'https://github.com/corda/corda'
|
url config.vcsUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
licenses {
|
licenses {
|
||||||
license {
|
license {
|
||||||
name 'Apache-2.0'
|
name config.license.name
|
||||||
url 'https://www.apache.org/licenses/LICENSE-2.0'
|
url config.license.url
|
||||||
distribution 'repo'
|
distribution config.license.url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
developers {
|
developers {
|
||||||
developer {
|
developer {
|
||||||
id 'R3'
|
id config.developer.id
|
||||||
name 'R3'
|
name config.developer.name
|
||||||
email 'dev@corda.net'
|
email config.developer.email
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void configureBintray(def bintray, def bintrayConfig) {
|
void configureBintray(def bintray, BintrayConfigExtension bintrayConfig) {
|
||||||
bintray.user = bintrayConfig.user
|
bintray.user = bintrayConfig.user
|
||||||
bintray.key = bintrayConfig.key
|
bintray.key = bintrayConfig.key
|
||||||
bintray.publications = [ project.name ]
|
bintray.publications = [ project.name ]
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
package net.corda.plugins
|
package net.corda.plugins.bintray
|
||||||
|
|
||||||
|
import org.gradle.util.ConfigureUtil
|
||||||
|
|
||||||
class BintrayConfigExtension {
|
class BintrayConfigExtension {
|
||||||
/**
|
/**
|
||||||
@ -29,6 +31,14 @@ class BintrayConfigExtension {
|
|||||||
* The passphrase for the key used to sign releases.
|
* The passphrase for the key used to sign releases.
|
||||||
*/
|
*/
|
||||||
String gpgPassphrase
|
String gpgPassphrase
|
||||||
|
/**
|
||||||
|
* VCS URL
|
||||||
|
*/
|
||||||
|
String vcsUrl
|
||||||
|
/**
|
||||||
|
* Project URL
|
||||||
|
*/
|
||||||
|
String projectUrl
|
||||||
/**
|
/**
|
||||||
* The publications that will be uploaded as a part of this configuration. These must match both the name on
|
* The publications that will be uploaded as a part of this configuration. These must match both the name on
|
||||||
* bintray and the gradle module name. ie; it must be "some-package" as a gradle sub-module (root project not
|
* bintray and the gradle module name. ie; it must be "some-package" as a gradle sub-module (root project not
|
||||||
@ -41,4 +51,20 @@ class BintrayConfigExtension {
|
|||||||
* Whether to test the publication without uploading to bintray.
|
* Whether to test the publication without uploading to bintray.
|
||||||
*/
|
*/
|
||||||
Boolean dryRun
|
Boolean dryRun
|
||||||
|
/**
|
||||||
|
* The license this project will use (currently limited to one)
|
||||||
|
*/
|
||||||
|
License license = new License()
|
||||||
|
/**
|
||||||
|
* The developer of this project (currently limited to one)
|
||||||
|
*/
|
||||||
|
Developer developer = new Developer()
|
||||||
|
|
||||||
|
void license(Closure closure) {
|
||||||
|
ConfigureUtil.configure(closure, license)
|
||||||
|
}
|
||||||
|
|
||||||
|
void developer(Closure closure) {
|
||||||
|
ConfigureUtil.configure(closure, developer)
|
||||||
|
}
|
||||||
}
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package net.corda.plugins.bintray
|
||||||
|
|
||||||
|
class Developer {
|
||||||
|
String id
|
||||||
|
String name
|
||||||
|
String email
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package net.corda.plugins.bintray
|
||||||
|
|
||||||
|
class License {
|
||||||
|
String name
|
||||||
|
String url
|
||||||
|
String distribution
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user