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+
57plugins {
68 plugin(Deps .Plugins .androidLibrary)
79 plugin(Deps .Plugins .kotlinMultiplatform)
810 plugin(Deps .Plugins .kotlinKapt)
911 plugin(Deps .Plugins .kotlinAndroidExtensions)
1012 plugin(Deps .Plugins .mobileMultiplatform)
1113 plugin(Deps .Plugins .mavenPublish)
14+ plugin(Deps .Plugins .signing)
1215}
1316
1417group = " dev.icerock.moko"
@@ -25,13 +28,60 @@ dependencies {
2528 androidMainImplementation(Deps .Libs .Android .playServicesLocation)
2629}
2730
31+ val javadocJar by tasks.registering(Jar ::class ) {
32+ archiveClassifier.set(" javadoc" )
33+ }
34+
2835publishing {
29- repositories.maven(" https://api.bintray.com/maven/icerockdev/moko/moko-geo/;publish=1 " ) {
30- name = " bintray "
36+ repositories.maven(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ " ) {
37+ name = " OSSRH "
3138
3239 credentials {
33- username = System .getProperty(" BINTRAY_USER" )
34- password = System .getProperty(" BINTRAY_KEY" )
40+ username = System .getenv(" OSSRH_USER" )
41+ password = System .getenv(" OSSRH_KEY" )
42+ }
43+ }
44+
45+ publications.withType<MavenPublication > {
46+ // Stub javadoc.jar artifact
47+ artifact(javadocJar.get())
48+
49+ // Provide artifacts information requited by Maven Central
50+ pom {
51+ name.set(" MOKO geo" )
52+ description.set(" Geolocation access for mobile (android & ios) Kotlin Multiplatform development" )
53+ url.set(" https://github.com/icerockdev/moko-geo" )
54+ licenses {
55+ license {
56+ url.set(" https://github.com/icerockdev/moko-geo/blob/master/LICENSE.md" )
57+ }
58+ }
59+
60+ developers {
61+ developer {
62+ id.set(" Alex009" )
63+ name.set(" Aleksey Mikhailov" )
64+ email.set(" aleksey.mikhailov@icerockdev.com" )
65+ }
66+ }
67+
68+ scm {
69+ connection.set(" scm:git:ssh://github.com/icerockdev/moko-geo.git" )
70+ developerConnection.set(" scm:git:ssh://github.com/icerockdev/moko-geo.git" )
71+ url.set(" https://github.com/icerockdev/moko-geo" )
72+ }
3573 }
3674 }
37- }
75+ }
76+
77+ signing {
78+ val signingKeyId: String? = System .getenv(" SIGNING_KEY_ID" )
79+ val signingPassword: String? = System .getenv(" SIGNING_PASSWORD" )
80+ val signingKey: String? = System .getenv(" SIGNING_KEY" )?.let { base64Key ->
81+ String (Base64 .getDecoder().decode(base64Key))
82+ }
83+ if (signingKeyId != null ) {
84+ useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
85+ sign(publishing.publications)
86+ }
87+ }
0 commit comments