MicroUtils/publish.gradle

63 lines
2.3 KiB
Groovy
Raw Normal View History

2020-09-27 14:25:42 +00:00
apply plugin: 'com.jfrog.bintray'
apply from: "$publishMavenPath"
bintray {
user = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER')
key = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY')
filesSpec {
from "${buildDir}/publications/"
eachFile {
String directorySubname = it.getFile().parentFile.name
if (it.getName() == "module.json") {
if (directorySubname == "kotlinMultiplatform") {
it.setPath("${project.name}/${project.version}/${project.name}-${project.version}.module")
} else {
2020-11-10 14:53:08 +00:00
if (directorySubname.indexOf("android") != -1) {
it.setPath("${project.name}-android/${project.version}/${project.name}-android-${project.version}.module")
} else {
it.setPath("${project.name}-${directorySubname}/${project.version}/${project.name}-${directorySubname}-${project.version}.module")
}
2020-09-27 14:25:42 +00:00
}
} else {
if (directorySubname == "kotlinMultiplatform" && it.getName() == "pom-default.xml") {
it.setPath("${project.name}/${project.version}/${project.name}-${project.version}.pom")
} else {
it.exclude()
}
}
}
into "${project.group}".replace(".", "/")
}
publish = true
2020-09-27 16:55:50 +00:00
override = true
2020-09-27 14:25:42 +00:00
pkg {
repo = "MicroUtils"
name = "${project.name}"
2020-09-28 06:48:53 +00:00
vcsUrl = "https://github.com/InsanusMokrassar/MicroUtils"
2020-09-27 14:25:42 +00:00
licenses = ["Apache-2.0"]
version {
name = "${project.version}"
released = new Date()
vcsTag = "${project.version}"
gpg {
sign = true
passphrase = project.hasProperty('signing.gnupg.passphrase') ? project.property('signing.gnupg.passphrase') : System.getenv('signing.gnupg.passphrase')
}
}
}
}
bintrayUpload.doFirst {
publications = publishing.publications.collect {
if (it.name.contains('kotlinMultiplatform')) {
null
} else {
it.name
}
} - null
}
bintrayUpload.dependsOn publishToMavenLocal