SDI/maven.publish.gradle
2019-11-20 20:49:59 +06:00

61 lines
1.5 KiB
Groovy

apply plugin: 'maven-publish'
apply plugin: 'signing'
task javadocsJar(type: Jar) {
classifier = 'javadoc'
}
afterEvaluate {
project.publishing.publications.all {
// rename artifacts
groupId "${project.group}"
if (it.name.contains('kotlinMultiplatform')) {
artifactId = "${project.name}"
} else {
artifactId = "${project.name}-$name"
}
}
}
publishing {
publications.all {
artifact javadocsJar
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
description "${project_public_description}"
name "${project_public_name}"
url "${project_url}"
scm {
developerConnection "scm:git:[fetch=]${project_vcs}[push=]${project_vcs}"
url "${project_vcs}"
}
developers {
developer {
id "InsanusMokrassar"
name "Ovsyannikov Alexey"
email "ovsyannikov.alexey95@gmail.com"
}
}
licenses {
license {
name "${project_public_license_fullname}"
url "${project_public_license_url}"
distribution "repo"
}
}
}
}
}
}
signing {
useGpgCmd()
sign(publishing.publications)
}