From 611be13e8f41b7cde993f923b6f5128a962b0aa2 Mon Sep 17 00:00:00 2001
From: InsanusMokrassar <ovsyannikov.alexey95@gmail.com>
Date: Thu, 9 Jan 2020 17:26:40 +0600
Subject: [PATCH] refresh publish scripts

---
 postssystem.core/build.gradle            |  4 +-
 postssystem.core/gradle.properties       | 13 ------
 postssystem.core/maven.publish.gradle    | 53 +++++++++++-----------
 postssystem.core/publish.gradle          | 12 +++--
 postssystem.core/publish_config.json     |  2 +-
 postssystem.exposed/maven.publish.gradle | 56 +++++++++---------------
 postssystem.exposed/publish.gradle       | 12 ++++-
 7 files changed, 67 insertions(+), 85 deletions(-)

diff --git a/postssystem.core/build.gradle b/postssystem.core/build.gradle
index 918ad5c5..4d2526cc 100644
--- a/postssystem.core/build.gradle
+++ b/postssystem.core/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/postssystem.core/gradle.properties b/postssystem.core/gradle.properties
index 22a9106d..eea16254 100644
--- a/postssystem.core/gradle.properties
+++ b/postssystem.core/gradle.properties
@@ -1,16 +1,3 @@
 project_public_name=PostsSystemCore
 
-project_public_license_name=Apache-2.0
-project_public_license_fullname=The Apache Software License, Version 2.0
-project_public_license_url=https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore/src/master/LICENSE
-
-project_public_version=0.1.1
-project_public_group=com.insanusmokrassar
-project_public_description=Core library for PostsSystem
-
-project_bintray_repo=InsanusMokrassar
-
-project_url=https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore
-project_vcs=https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore.git
-
 kotlin.incremental.multiplatform=true
diff --git a/postssystem.core/maven.publish.gradle b/postssystem.core/maven.publish.gradle
index 33d23a3f..6b644803 100644
--- a/postssystem.core/maven.publish.gradle
+++ b/postssystem.core/maven.publish.gradle
@@ -1,5 +1,4 @@
 apply plugin: 'maven-publish'
-apply plugin: 'signing'
 
 task javadocsJar(type: Jar) {
     classifier = 'javadoc'
@@ -25,41 +24,41 @@ publishing {
             asNode().children().last() + {
                 resolveStrategy = Closure.DELEGATE_FIRST
 
-                description "${project_public_description}"
-                name "${project_public_name}"
-                url "${project_url}"
+                description "Core library for PostsSystem"
+                name "PostsSystem Core"
+                url "https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore"
 
                 scm {
-                    developerConnection "scm:git:[fetch=]${project_vcs}[push=]${project_vcs}"
-                    url "${project_vcs}"
+                    developerConnection "scm:git:[fetch=]https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore.git[push=]https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore.git"
+                    url "https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore.git"
                 }
 
                 developers {
-                    developer {
-                        id "InsanusMokrassar"
-                        name "Ovsyannikov Alexey"
-                        email "ovsyannikov.alexey95@gmail.com"
-                    }
-                    developer {
-                        id "mi-ast"
-                        name "Michail Astafiev"
-                        email "astaf65@gmail.com"
-                    }
+                    
+                        developer {
+                            id "InsanusMokrassar"
+                            name "Ovsiannikov Aleksei"
+                            email "ovsyannikov.alexey95@gmail.com"
+                        }
+                    
+
+                        developer {
+                            id "mi-ast"
+                            name "Michail Astafiev"
+                            email "astaf65@gmail.com"
+                        }
+                    
                 }
 
                 licenses {
-                    license {
-                        name "${project_public_license_fullname}"
-                        url "${project_public_license_url}"
-                        distribution "repo"
-                    }
+                    
+                        license {
+                            name "Apache Software License 2.0"
+                            url "https://opensource.org/licenses/Apache-2.0"
+                        }
+                    
                 }
             }
         }
     }
-}
-
-signing {
-    useGpgCmd()
-    sign(publishing.publications)
-}
+}
\ No newline at end of file
diff --git a/postssystem.core/publish.gradle b/postssystem.core/publish.gradle
index 5a9be9a2..348c511d 100644
--- a/postssystem.core/publish.gradle
+++ b/postssystem.core/publish.gradle
@@ -6,14 +6,18 @@ 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')
     pkg {
-        repo = "$project_bintray_repo"
+        repo = "InsanusMokrassar"
         name = "${project.name}"
-        vcsUrl = "${project_url}"
-        licenses = ["${project_public_license_name}"]
+        vcsUrl = "https://github.com/PostsSystem/PostsSystemCore"
+        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')
+            }
         }
     }
 }
@@ -24,4 +28,4 @@ bintrayUpload.doFirst {
     }
 }
 
-bintrayUpload.dependsOn publishToMavenLocal
+bintrayUpload.dependsOn publishToMavenLocal
\ No newline at end of file
diff --git a/postssystem.core/publish_config.json b/postssystem.core/publish_config.json
index f1c78b6a..13f4058c 100644
--- a/postssystem.core/publish_config.json
+++ b/postssystem.core/publish_config.json
@@ -1 +1 @@
-{"bintrayConfig":{"repo":"InsanusMokrassar","packageName":"${project.name}","packageVcs":"https://github.com/PostsSystem/PostsSystemCore"},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://opensource.org/licenses/Apache-2.0"}],"mavenConfig":{"name":"PostsSystem Core","description":"Core library for PostsSystem","url":"https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore","vcsUrl":"https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"},{"id":"mi-ast","name":"Michail Astafiev","eMail":"astaf65@gmail.com"}]}}
\ No newline at end of file
+{"bintrayConfig":{"repo":"InsanusMokrassar","packageName":"${project.name}","packageVcs":"https://github.com/PostsSystem/PostsSystemCore"},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore/src/master/LICENSE"}],"mavenConfig":{"name":"PostsSystem Core","description":"Core library for PostsSystem","url":"https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore","vcsUrl":"https://git.insanusmokrassar.com/PostsSystem/PostsSystemCore.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"},{"id":"mi-ast","name":"Michail Astafiev","eMail":"astaf65@gmail.com"}]}}
\ No newline at end of file
diff --git a/postssystem.exposed/maven.publish.gradle b/postssystem.exposed/maven.publish.gradle
index e82972ba..fe831bd3 100644
--- a/postssystem.exposed/maven.publish.gradle
+++ b/postssystem.exposed/maven.publish.gradle
@@ -1,13 +1,6 @@
 apply plugin: 'maven-publish'
-apply plugin: 'signing'
 
-task sourcesJar(type: Jar) {
-    from sourceSets.main.allSource
-    classifier = 'sources'
-}
-
-task javadocJar(type: Jar) {
-    from javadoc
+task javadocsJar(type: Jar) {
     classifier = 'javadoc'
 }
 
@@ -24,50 +17,41 @@ afterEvaluate {
 }
 
 publishing {
-    publications {
-        maven(MavenPublication) {
-            from components.java
-            artifact javadocJar
-            artifact sourcesJar
+    publications.all {
+        artifact javadocsJar
 
-            pom.withXml {
-                asNode().children().last() + {
-                    resolveStrategy = Closure.DELEGATE_FIRST
+        pom.withXml {
+            asNode().children().last() + {
+                resolveStrategy = Closure.DELEGATE_FIRST
 
-                    description "Exposed realisation for PostsSystem Core"
-                    name "PostsSystem Core Exposed realization"
-                    url "https://git.insanusmokrassar.com/PostsSystem/Core/"
+                description "Exposed realisation for PostsSystem Core"
+                name "PostsSystem Core Exposed realization"
+                url "https://git.insanusmokrassar.com/PostsSystem/Core/"
 
-                    scm {
-                        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"
-                    }
-
-                    developers {
+                scm {
+                    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"
+                }
 
+                developers {
+                    
                         developer {
                             id "InsanusMokrassar"
                             name "Ovsiannikov Aleksei"
                             email "ovsyannikov.alexey95@gmail.com"
                         }
+                    
+                }
 
-                    }
-
-                    licenses {
-
+                licenses {
+                    
                         license {
                             name "Apache Software License 2.0"
                             url "https://git.insanusmokrassar.com/PostsSystem/Core/src/master/LICENSE"
                         }
-
-                    }
+                    
                 }
             }
         }
     }
-}
-
-signing {
-    useGpgCmd()
-    sign publishing.publications.maven
 }
\ No newline at end of file
diff --git a/postssystem.exposed/publish.gradle b/postssystem.exposed/publish.gradle
index 9d1376fc..348c511d 100644
--- a/postssystem.exposed/publish.gradle
+++ b/postssystem.exposed/publish.gradle
@@ -1,10 +1,10 @@
 apply plugin: 'com.jfrog.bintray'
 
+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')
-    publications = ["maven"]
     pkg {
         repo = "InsanusMokrassar"
         name = "${project.name}"
@@ -14,10 +14,18 @@ bintray {
             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')
+            }
         }
     }
 }
 
-apply from: "maven.publish.gradle"
+bintrayUpload.doFirst {
+    publications = publishing.publications.collect {
+        it.name
+    }
+}
 
 bintrayUpload.dependsOn publishToMavenLocal
\ No newline at end of file