Added documentation and extra logging to publish tasks (#2427)

Added documentation and extra logging to publish tasks
This commit is contained in:
Clinton 2018-01-31 20:56:25 +00:00 committed by GitHub
parent 409cdf05e0
commit 781d517761
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,10 @@ class PublishTasks implements Plugin<Project> {
createConfigurations()
}
/**
* This call must come at the end of any publish block because it configures the publishing and any
* values set after this call in the DSL will not be configured properly (and will use the default value)
*/
void setPublishName(String publishName) {
project.logger.info("Changing publishing name from ${project.name} to ${publishName}")
this.publishName = publishName
@ -51,12 +55,14 @@ class PublishTasks implements Plugin<Project> {
}
void configureMavenPublish(BintrayConfigExtension bintrayConfig) {
project.logger.info("Configuring maven publish for $publishName")
project.apply([plugin: 'maven-publish'])
project.publishing.publications.create(publishName, MavenPublication) {
groupId project.group
artifactId publishName
if (publishConfig.publishSources) {
project.logger.info("Publishing sources for $publishName")
artifact project.tasks.sourceJar
}
artifact project.tasks.javadocJar