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 .mobileMultiplatform)
912 plugin(Deps .Plugins .mavenPublish)
13+ plugin(Deps .Plugins .signing)
1014}
1115
1216group = " dev.icerock.moko"
@@ -16,13 +20,60 @@ dependencies {
1620 androidMainImplementation(Deps .Libs .Android .appCompat)
1721}
1822
23+ val javadocJar by tasks.registering(Jar ::class ) {
24+ archiveClassifier.set(" javadoc" )
25+ }
26+
1927publishing {
20- repositories.maven(" https://api.bintray.com/maven/icerockdev/moko/moko-crash-reporting/;publish=1 " ) {
21- name = " bintray "
28+ repositories.maven(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ " ) {
29+ name = " OSSRH "
2230
2331 credentials {
24- username = System .getProperty(" BINTRAY_USER" )
25- password = System .getProperty(" BINTRAY_KEY" )
32+ username = System .getenv(" OSSRH_USER" )
33+ password = System .getenv(" OSSRH_KEY" )
34+ }
35+ }
36+
37+ publications.withType<MavenPublication > {
38+ // Stub javadoc.jar artifact
39+ artifact(javadocJar.get())
40+
41+ // Provide artifacts information requited by Maven Central
42+ pom {
43+ name.set(" MOKO crash reporting" )
44+ description.set(" Fatal and Non-Fatal reporting to Crashlytics for Kotlin Multiplatform Mobile" )
45+ url.set(" https://github.com/icerockdev/moko-crash-reporting" )
46+ licenses {
47+ license {
48+ url.set(" https://github.com/icerockdev/moko-crash-reporting/blob/master/LICENSE.md" )
49+ }
50+ }
51+
52+ developers {
53+ developer {
54+ id.set(" Alex009" )
55+ name.set(" Aleksey Mikhailov" )
56+ email.set(" aleksey.mikhailov@icerockdev.com" )
57+ }
58+ }
59+
60+ scm {
61+ connection.set(" scm:git:ssh://github.com/icerockdev/moko-crash-reporting.git" )
62+ developerConnection.set(" scm:git:ssh://github.com/icerockdev/moko-crash-reporting.git" )
63+ url.set(" https://github.com/icerockdev/moko-crash-reporting" )
64+ }
65+ }
66+ }
67+
68+ signing {
69+ val signingKeyId: String? = System .getenv(" SIGNING_KEY_ID" )
70+ val signingPassword: String? = System .getenv(" SIGNING_PASSWORD" )
71+ val signingKey: String? = System .getenv(" SIGNING_KEY" )?.let { base64Key ->
72+ String (Base64 .getDecoder().decode(base64Key))
73+ }
74+ if (signingKeyId != null ) {
75+ useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
76+ sign(publishing.publications)
2677 }
2778 }
2879}
0 commit comments