This commit is contained in:
InsanusMokrassar 2020-04-10 16:44:22 +06:00
parent 9b48cc9214
commit bf5032724f
3 changed files with 52 additions and 69 deletions

View File

@ -20,7 +20,7 @@ project.version = "$core_version"
project.group = "com.insanusmokrassar" project.group = "com.insanusmokrassar"
apply plugin: "java-library" apply plugin: "java-library"
apply plugin: 'kotlin' apply plugin: "kotlin"
repositories { repositories {
mavenLocal() mavenLocal()

View File

@ -1,55 +1,54 @@
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
pom.withXml { artifact sourcesJar
asNode().children().last() + { artifact javadocJar
resolveStrategy = Closure.DELEGATE_FIRST
description "Exposed realisation for PostsSystem Core" pom.withXml {
name "PostsSystem Core Exposed realization" asNode().children().last() + {
url "https://git.insanusmokrassar.com/PostsSystem/Core/" resolveStrategy = Closure.DELEGATE_FIRST
scm { description "Exposed realisation for PostsSystem Core"
developerConnection "scm:git:[fetch=]https://git.insanusmokrassar.com/PostsSystem/Core/.git[push=]https://git.insanusmokrassar.com/PostsSystem/Core/.git" name "PostsSystem Core Exposed realization"
url "https://git.insanusmokrassar.com/PostsSystem/Core/.git" url "https://git.insanusmokrassar.com/PostsSystem/Core/"
}
developers { scm {
developerConnection "scm:git:[fetch=]https://git.insanusmokrassar.com/PostsSystem/Core/.git[push=]https://git.insanusmokrassar.com/PostsSystem/Core/.git"
developer { url "https://git.insanusmokrassar.com/PostsSystem/Core/.git"
id "InsanusMokrassar" }
name "Ovsiannikov Aleksei"
email "ovsyannikov.alexey95@gmail.com"
}
}
licenses { developers {
license { developer {
name "Apache Software License 2.0" id "InsanusMokrassar"
url "https://git.insanusmokrassar.com/PostsSystem/Core/src/master/LICENSE" name "Ovsiannikov Aleksei"
} email "ovsyannikov.alexey95@gmail.com"
}
}
licenses {
license {
name "Apache Software License 2.0"
url "https://git.insanusmokrassar.com/PostsSystem/Core/src/master/LICENSE"
}
}
} }
} }
} }

View File

@ -1,29 +1,21 @@
apply plugin: 'com.jfrog.bintray' apply plugin: 'com.jfrog.bintray'
apply from: "maven.publish.gradle" ext {
projectBintrayDir = "${project.group}/".replace(".", "/") + "${project.name}/${project.version}"
}
bintray { 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')
publications = ["maven"]
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"
@ -42,14 +34,6 @@ bintray {
} }
} }
bintrayUpload.doFirst { apply from: "maven.publish.gradle"
publications = publishing.publications.collect {
if (it.name.contains('kotlinMultiplatform')) {
null
} else {
it.name
}
} - null
}
bintrayUpload.dependsOn publishToMavenLocal bintrayUpload.dependsOn publishToMavenLocal