22 * Copyright 2019 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 .kotlinParcelize)
912 plugin(Deps .Plugins .mobileMultiPlatform)
1013 plugin(Deps .Plugins .mavenPublish)
14+ plugin(Deps .Plugins .signing)
1115}
1216
1317group = " dev.icerock.moko"
@@ -61,13 +65,17 @@ fun org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension.windows() {
6165 mingwX86()
6266}
6367
68+ val javadocJar by tasks.registering(Jar ::class ) {
69+ archiveClassifier.set(" javadoc" )
70+ }
71+
6472publishing {
65- repositories.maven(" https://api.bintray.com/maven/icerockdev/moko/moko-parcelize/;publish=1 " ) {
66- name = " bintray "
73+ repositories.maven(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ " ) {
74+ name = " OSSRH "
6775
6876 credentials {
69- username = System .getProperty( " BINTRAY_USER " )
70- password = System .getProperty( " BINTRAY_KEY " )
77+ username = System .getenv( " OSSRH_USER " )
78+ password = System .getenv( " OSSRH_KEY " )
7179 }
7280 }
7381
@@ -92,4 +100,52 @@ publishing {
92100 .matching { it.publication == targetPublication }
93101 .all { onlyIf { System .getProperty(" IS_MAIN_HOST" ) == " true" } }
94102 }
103+
104+ publications.withType<MavenPublication > {
105+ // Stub javadoc.jar artifact
106+ artifact(javadocJar.get())
107+
108+ // Provide artifacts information requited by Maven Central
109+ pom {
110+ name.set(" MOKO parcelize" )
111+ description.set(" @Parcelize support for android from common code in Kotlin Multiplatform" )
112+ url.set(" https://github.com/icerockdev/moko-parcelize" )
113+ licenses {
114+ license {
115+ url.set(" https://github.com/icerockdev/moko-parcelize/blob/master/LICENSE.md" )
116+ }
117+ }
118+
119+ developers {
120+ developer {
121+ id.set(" Alex009" )
122+ name.set(" Aleksey Mikhailov" )
123+ 124+ }
125+ developer {
126+ id.set(" nrobi144" )
127+ name.set(" Nagy Robert" )
128+ 129+ }
130+ }
131+
132+ scm {
133+ connection.set(" scm:git:ssh://github.com/icerockdev/moko-parcelize.git" )
134+ developerConnection.set(" scm:git:ssh://github.com/icerockdev/moko-parcelize.git" )
135+ url.set(" https://github.com/icerockdev/moko-parcelize" )
136+ }
137+ }
138+ }
139+
140+ signing {
141+ val signingKeyId: String? = System .getenv(" SIGNING_KEY_ID" )
142+ val signingPassword: String? = System .getenv(" SIGNING_PASSWORD" )
143+ val signingKey: String? = System .getenv(" SIGNING_KEY" )?.let { base64Key ->
144+ String (Base64 .getDecoder().decode(base64Key))
145+ }
146+ if (signingKeyId != null ) {
147+ useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
148+ sign(publishing.publications)
149+ }
150+ }
95151}
0 commit comments