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 .mokoResources)
1114 plugin(Deps .Plugins .mavenPublish)
15+ plugin(Deps .Plugins .signing)
1216}
1317
1418group = " dev.icerock.moko"
@@ -32,13 +36,66 @@ multiplatformResources {
3236 multiplatformResourcesPackage = " dev.icerock.moko.errors"
3337}
3438
39+ val javadocJar by tasks.registering(Jar ::class ) {
40+ archiveClassifier.set(" javadoc" )
41+ }
42+
3543publishing {
36- repositories.maven(" https://api.bintray.com/maven/icerockdev/moko/moko-errors/;publish=1 " ) {
37- name = " bintray "
44+ repositories.maven(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ " ) {
45+ name = " OSSRH "
3846
3947 credentials {
40- username = System .getProperty(" BINTRAY_USER" )
41- password = System .getProperty(" BINTRAY_KEY" )
48+ username = System .getenv(" OSSRH_USER" )
49+ password = System .getenv(" OSSRH_KEY" )
50+ }
51+ }
52+
53+ publications.withType<MavenPublication > {
54+ // Stub javadoc.jar artifact
55+ artifact(javadocJar.get())
56+
57+ // Provide artifacts information requited by Maven Central
58+ pom {
59+ name.set(" MOKO errors" )
60+ description.set(" Automated exceptions handler for mobile (android & ios) Kotlin Multiplatform development." )
61+ url.set(" https://github.com/icerockdev/moko-errors" )
62+ licenses {
63+ license {
64+ url.set(" https://github.com/icerockdev/moko-errors/blob/master/LICENSE.md" )
65+ }
66+ }
67+
68+ developers {
69+ developer {
70+ id.set(" Tetraquark" )
71+ name.set(" Vladislav Areshkin" )
72+ email.set(" vareshkin@icerockdev.com" )
73+ }
74+ developer {
75+ id.set(" Alex009" )
76+ name.set(" Aleksey Mikhailov" )
77+ email.set(" aleksey.mikhailov@icerockdev.com" )
78+ }
79+ }
80+
81+ scm {
82+ connection.set(" scm:git:ssh://github.com/icerockdev/moko-errors.git" )
83+ developerConnection.set(" scm:git:ssh://github.com/icerockdev/moko-errors.git" )
84+ url.set(" https://github.com/icerockdev/moko-errors" )
85+ }
86+ }
87+ }
88+
89+ signing {
90+ val signingKeyId: String? = System .getenv(" SIGNING_KEY_ID" )
91+ val signingPassword: String? = System .getenv(" SIGNING_PASSWORD" )
92+ val signingKey: String? = System .getenv(" SIGNING_KEY" )?.let { base64Key ->
93+ String (Base64 .getDecoder().decode(base64Key))
94+ }
95+ if (signingKeyId != null ) {
96+ useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
97+ sign(publishing.publications)
4298 }
4399 }
44100}
101+
0 commit comments