22 * Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
33 */
44
5+ import java.util.Base64
6+ import kotlin.text.String
7+
58plugins {
69 plugin(Deps .Plugins .androidLibrary)
710 plugin(Deps .Plugins .kotlinMultiplatform)
811 plugin(Deps .Plugins .kotlinAndroidExtensions)
912 plugin(Deps .Plugins .mobileMultiplatform)
1013 plugin(Deps .Plugins .mavenPublish)
14+ plugin(Deps .Plugins .signing)
1115}
1216
1317group = " dev.icerock.moko"
@@ -22,13 +26,65 @@ dependencies {
2226 }
2327}
2428
29+ val javadocJar by tasks.registering(Jar ::class ) {
30+ archiveClassifier.set(" javadoc" )
31+ }
32+
2533publishing {
26- repositories.maven(" https://api.bintray.com/maven/icerockdev/moko/moko-socket-io/;publish=1 " ) {
27- name = " bintray "
34+ repositories.maven(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ " ) {
35+ name = " OSSRH "
2836
2937 credentials {
30- username = System .getProperty(" BINTRAY_USER" )
31- password = System .getProperty(" BINTRAY_KEY" )
38+ username = System .getenv(" OSSRH_USER" )
39+ password = System .getenv(" OSSRH_KEY" )
40+ }
41+ }
42+
43+ publications.withType<MavenPublication > {
44+ // Stub javadoc.jar artifact
45+ artifact(javadocJar.get())
46+
47+ // Provide artifacts information requited by Maven Central
48+ pom {
49+ name.set(" MOKO socket io" )
50+ description.set(" Socket.IO implementation Kotlin Multiplatform library" )
51+ url.set(" https://github.com/icerockdev/moko-socket-io" )
52+ licenses {
53+ license {
54+ url.set(" https://github.com/icerockdev/moko-socket-io/blob/master/LICENSE.md" )
55+ }
56+ }
57+
58+ developers {
59+ developer {
60+ id.set(" Alex009" )
61+ name.set(" Aleksey Mikhailov" )
62+ 63+ }
64+ developer {
65+ id.set(" Dorofeev" )
66+ name.set(" Andrey Dorofeef" )
67+ 68+ }
69+ }
70+
71+ scm {
72+ connection.set(" scm:git:ssh://github.com/icerockdev/moko-socket-io.git" )
73+ developerConnection.set(" scm:git:ssh://github.com/icerockdev/moko-socket-io.git" )
74+ url.set(" https://github.com/icerockdev/moko-socket-io" )
75+ }
76+ }
77+ }
78+
79+ signing {
80+ val signingKeyId: String? = System .getenv(" SIGNING_KEY_ID" )
81+ val signingPassword: String? = System .getenv(" SIGNING_PASSWORD" )
82+ val signingKey: String? = System .getenv(" SIGNING_KEY" )?.let { base64Key ->
83+ String (Base64 .getDecoder().decode(base64Key))
84+ }
85+ if (signingKeyId != null ) {
86+ useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
87+ sign(publishing.publications)
3288 }
3389 }
3490}
0 commit comments