fixes in publication scripts

This commit is contained in:
InsanusMokrassar 2020-01-31 18:14:01 +06:00
parent dfeb628fd1
commit 2ae3fd493c
2 changed files with 39 additions and 49 deletions

View File

@ -1,55 +1,56 @@
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
task javadocsJar(type: Jar) { task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar) {
from javadoc
classifier = 'javadoc' 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 { publishing {
publications.all { publications {
artifact javadocsJar maven(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId "${project.group}"
artifactId "${project.name}"
version "${project.version}"
pom.withXml { pom.withXml {
asNode().children().last() + { asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST resolveStrategy = Closure.DELEGATE_FIRST
description "Exposed realisation for PostsSystem Core" description "Exposed realisation for PostsSystem Core"
name "PostsSystem Core Exposed realization" name "PostsSystem Core Exposed realization"
url "https://git.insanusmokrassar.com/PostsSystem/Core/" url "https://git.insanusmokrassar.com/PostsSystem/Core/"
scm { scm {
developerConnection "scm:git:[fetch=]https://git.insanusmokrassar.com/PostsSystem/Core/.git[push=]https://git.insanusmokrassar.com/PostsSystem/Core/.git" developerConnection "scm:git:[fetch=]https://git.insanusmokrassar.com/PostsSystem/Core/.git[push=]https://git.insanusmokrassar.com/PostsSystem/Core/.git"
url "https://git.insanusmokrassar.com/PostsSystem/Core/.git" url "https://git.insanusmokrassar.com/PostsSystem/Core/.git"
} }
developers {
developers {
developer { developer {
id "InsanusMokrassar" id "InsanusMokrassar"
name "Ovsiannikov Aleksei" name "Ovsiannikov Aleksei"
email "ovsyannikov.alexey95@gmail.com" email "ovsyannikov.alexey95@gmail.com"
} }
}
licenses { }
licenses {
license { license {
name "Apache Software License 2.0" name "Apache Software License 2.0"
url "https://git.insanusmokrassar.com/PostsSystem/Core/src/master/LICENSE" url "https://git.insanusmokrassar.com/PostsSystem/Core/src/master/LICENSE"
} }
}
} }
} }
} }

View File

@ -6,24 +6,13 @@ bintray {
user = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER') 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') key = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY')
filesSpec { filesSpec {
from "${buildDir}/publications/" into "$projectBintrayDir"
eachFile { from("build/libs") {
String directorySubname = it.getFile().parentFile.name include "**/*.asc"
if (it.getName() == "module.json") { }
if (directorySubname == "kotlinMultiplatform") { from("build/publications/maven") {
it.setPath("${project.name}/${project.version}/${project.name}-${project.version}.module") rename 'pom-default.xml(.*)', "${project.name}-${project.version}.pom\$1"
} else {
it.setPath("${project.name}-${directorySubname}/${project.version}/${project.name}-${directorySubname}-${project.version}.module")
}
} 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(".", "/")
} }
pkg { pkg {
repo = "InsanusMokrassar" repo = "InsanusMokrassar"