build: use the same custom pom file for 'install', 'uploadArchives' and 'uploadBintray'. A custom pom with minimal information required to maven central

experimental
David Bernard 9 years ago
parent 142d7bebae
commit 2aca942b1b
  1. 5
      bintray.gradle
  2. 90
      common.gradle

@ -8,6 +8,7 @@ bintray {
user = bintray_user user = bintray_user
key = bintray_api_key key = bintray_api_key
configurations = ['archives'] configurations = ['archives']
dryRun = false
pkg { pkg {
repo = 'org.jmonkeyengine' repo = 'org.jmonkeyengine'
userOrg = 'jmonkeyengine' userOrg = 'jmonkeyengine'
@ -15,11 +16,13 @@ bintray {
desc = POM_DESCRIPTION desc = POM_DESCRIPTION
websiteUrl = POM_URL websiteUrl = POM_URL
licenses = ['BSD New'] licenses = ['BSD New']
vcsUrl = POM_SCM_CONNECTION vcsUrl = POM_SCM_URL
labels = ['jmonkeyengine'] labels = ['jmonkeyengine']
} }
} }
bintrayUpload.dependsOn(writeFullPom)
bintrayUpload.onlyIf { bintrayUpload.onlyIf {
(bintray_api_key.length() > 0) && (bintray_api_key.length() > 0) &&
!(version ==~ /.*SNAPSHOT/) !(version ==~ /.*SNAPSHOT/)

@ -61,12 +61,84 @@ task javadocJar(type: Jar, dependsOn: javadoc, description: 'Creates a jar from
from javadoc.destinationDir from javadoc.destinationDir
} }
def pomConfig = {
name POM_NAME
description POM_DESCRIPTION
url POM_URL
inceptionYear '2016'
scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEVELOPER_CONNECTION
}
licenses {
license {
name POM_LICENSE_NAME
url POM_LICENSE_URL
distribution POM_LICENSE_DISTRIBUTION
}
}
// from http://hub.jmonkeyengine.org/introduction/team/
developers {
developer {
name 'Kirill Vainer'
id 'Momoko_Fan'
}
developer {
name 'Erlend Sogge Heggen'
id 'erlend_sh'
}
developer {
name 'Skye Book'
id 'sbook'
}
developer {
name 'Normen Hansen'
id 'normen'
}
developer {
name 'Ruth Kusterer'
id 'zathras'
}
developer {
name 'Rémy Bouquet'
id 'nehon'
}
developer {
name 'Paul Speed'
id 'pspeed'
}
developer {
name 'Brent Owens'
id 'Sploreg'
}
developer {
name 'Eric Potter'
id 'iwgeric'
}
}
}
// workaround to be able to use same custom pom with 'maven' and 'bintray' plugin
task writeFullPom {
ext.pomFile = "$mavenPomDir/${project.name}-${project.version}.pom"
outputs.file pomFile
doLast {
pom {
project pomConfig
}.writeTo(pomFile)
}
}
install.dependsOn(writeFullPom)
uploadArchives.dependsOn(writeFullPom)
artifacts { artifacts {
archives jar archives jar
archives sourcesJar archives sourcesJar
if(buildJavaDoc == "true"){ if(buildJavaDoc == "true"){
archives javadocJar archives javadocJar
} }
archives writeFullPom.outputs.files[0]
} }
uploadArchives { uploadArchives {
@ -80,23 +152,7 @@ uploadArchives {
authentication(userName: "www-updater", privateKey: "private/www-updater.key") authentication(userName: "www-updater", privateKey: "private/www-updater.key")
} }
pom.project { pom.project pomConfig
name POM_NAME
description POM_DESCRIPTION
url POM_URL
scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEVELOPER_CONNECTION
}
licenses {
license {
name POM_LICENSE_NAME
url POM_LICENSE_URL
distribution POM_LICENSE_DISTRIBUTION
}
}
}
} }
} }

Loading…
Cancel
Save