From af6a74283aa3c195d74b2685304d25aea76705ab Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 19 Jan 2020 14:07:11 +0600 Subject: [PATCH] update publish scripts --- build.gradle | 4 ++-- gradle.properties | 4 ---- maven.publish.gradle | 10 ++-------- mpp_publish_config.json | 1 + publish.gradle | 34 +++++++++++++++++++++++++++++++--- 5 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 mpp_publish_config.json diff --git a/build.gradle b/build.gradle index 1482a23..0134720 100644 --- a/build.gradle +++ b/build.gradle @@ -17,8 +17,8 @@ plugins { id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version" } -project.version = "$project_public_version" -project.group = "$project_public_group" +project.version = "0.1.1" +project.group = "com.insanusmokrassar" apply from: "publish.gradle" diff --git a/gradle.properties b/gradle.properties index a1009d7..abf984d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,8 +4,4 @@ kotlin_serialisation_runtime_version=0.14.0 gradle_bintray_plugin_version=1.8.4 -project_public_version=0.1.1 -project_public_group=com.insanusmokrassar -project_public_description=Simple DI library - kotlin.incremental.multiplatform=true diff --git a/maven.publish.gradle b/maven.publish.gradle index 814cc05..b69d55b 100644 --- a/maven.publish.gradle +++ b/maven.publish.gradle @@ -1,5 +1,4 @@ apply plugin: 'maven-publish' -apply plugin: 'signing' task javadocsJar(type: Jar) { classifier = 'javadoc' @@ -25,8 +24,8 @@ publishing { asNode().children().last() + { resolveStrategy = Closure.DELEGATE_FIRST - description "Simple DI library" - name "Simple Dependency Injection" + description "Simple library for creating dependencies tree using Kotlin Serialization" + name "Simple Dependency Injector" url "https://git.insanusmokrassar.com/InsanusMokrassar/SDI" scm { @@ -55,9 +54,4 @@ publishing { } } } -} - -signing { - useGpgCmd() - sign(publishing.publications) } \ No newline at end of file diff --git a/mpp_publish_config.json b/mpp_publish_config.json new file mode 100644 index 0000000..d9c0e56 --- /dev/null +++ b/mpp_publish_config.json @@ -0,0 +1 @@ +{"bintrayConfig":{"repo":"InsanusMokrassar","packageName":"${project.name}","packageVcs":"https://git.insanusmokrassar.com/InsanusMokrassar/SDI.git"},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://git.insanusmokrassar.com/PostsSystem/SDI/src/master/LICENSE"}],"mavenConfig":{"name":"Simple Dependency Injector","description":"Simple library for creating dependencies tree using Kotlin Serialization","url":"https://git.insanusmokrassar.com/InsanusMokrassar/SDI","vcsUrl":"https://git.insanusmokrassar.com/InsanusMokrassar/SDI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]}} \ No newline at end of file diff --git a/publish.gradle b/publish.gradle index cf49a3e..ac52dec 100644 --- a/publish.gradle +++ b/publish.gradle @@ -5,23 +5,51 @@ apply from: "maven.publish.gradle" 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 { + 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 { repo = "InsanusMokrassar" name = "${project.name}" - vcsUrl = "https://github.com/InsanusMokrassar/SDI_mirror" + vcsUrl = "https://git.insanusmokrassar.com/InsanusMokrassar/SDI.git" 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 { - it.name - } + if (it.name.contains('kotlinMultiplatform')) { + null + } else { + it.name + } + } - null } bintrayUpload.dependsOn publishToMavenLocal \ No newline at end of file