1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
apply plugin: 'maven'
apply plugin: 'signing'
signing {
required {
gradle.taskGraph.hasTask("signArchives") ||
gradle.taskGraph.hasTask("uploadArchives") ||
(project.hasProperty('signing.keyId') &&
project.hasProperty('signing.password') &&
project.hasProperty('signing.secretKeyRingFile'))
}
sign configurations.archives
}
ext.mavenRepo = rootProject.hasProperty('mavenRepo')?project.mavenRepo:System.getenv('MAVEN_REPO')?:''
ext.mavenUser = rootProject.hasProperty('mavenUser')?project.mavenUser:System.getenv('MAVEN_USER')?:''
ext.mavenPassword = rootProject.hasProperty('mavenPassword')?project.mavenPassword:System.getenv('MAVEN_PASSWORD')?:''
ext.projectPom = {
pom {
project {
name project.ext.displayName
description project.ext.description
url 'https://zeroc.com'
packaging 'jar'
scm {
connection 'scm:git:git@github.com/zeroc-ice/ice.git'
developerConnection 'scm:git:git@github.com/zeroc-ice/ice.git'
url 'git://github.com/zeroc-ice/ice.git'
}
licenses {
license {
name 'GNU General Public License, version 2'
url 'https://www.gnu.org/licenses/gpl-2.0.html'
distribution 'repo'
}
}
developers {
developer {
name 'ZeroC Developers'
email 'info@zeroc.com'
organization = 'ZeroC, Inc.'
organizationUrl 'https://zeroc.com'
}
}
}
}
}
task writeNewPom {
outputs.file file(project.ext.pomName)
doLast {
projectPom().writeTo(project.ext.pomName)
}
}
jar.dependsOn(writeNewPom)
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: mavenRepo) {
authentication(userName: mavenUser, password: mavenPassword)
}
pom = projectPom()
}
}
}
|