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+
57plugins {
68 plugin(Deps .Plugins .detekt) apply false
79}
810
911buildscript {
1012 repositories {
11- jcenter ()
13+ mavenCentral ()
1214 google()
1315
14- maven { url = uri(" https://dl.bintray.com/kotlin/kotlin" ) }
15- maven { url = uri(" https://kotlin.bintray.com/kotlinx" ) }
16- maven { url = uri(" https://plugins.gradle.org/m2/" ) }
16+ jcenter {
17+ content {
18+ includeGroup(" org.jetbrains.trove4j" )
19+ }
20+ }
1721 }
1822 dependencies {
1923 plugin(Deps .Plugins .googleServices)
@@ -23,13 +27,17 @@ buildscript {
2327
2428allprojects {
2529 repositories {
30+ mavenCentral()
2631 google()
27- jcenter()
2832
29- maven { url = uri(" https://kotlin.bintray.com/kotlin" ) }
30- maven { url = uri(" https://kotlin.bintray.com/kotlinx" ) }
3133 maven { url = uri(" https://dl.bintray.com/aakira/maven" ) }
32- maven { url = uri(" https://dl.bintray.com/icerockdev/moko" ) }
34+
35+ jcenter {
36+ content {
37+ includeGroup(" org.jetbrains.trove4j" )
38+ includeGroup(" org.jetbrains.kotlinx" )
39+ }
40+ }
3341 }
3442
3543 apply (plugin = Deps .Plugins .detekt.id)
@@ -53,6 +61,75 @@ allprojects {
5361 }
5462 }
5563
64+ plugins.withId(Deps .Plugins .mavenPublish.id) {
65+ group = " dev.icerock.moko"
66+ version = Deps .mokoCrashReportingVersion
67+
68+ val javadocJar by tasks.registering(Jar ::class ) {
69+ archiveClassifier.set(" javadoc" )
70+ }
71+
72+ configure<PublishingExtension > {
73+ repositories.maven(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" ) {
74+ name = " OSSRH"
75+
76+ credentials {
77+ username = System .getenv(" OSSRH_USER" )
78+ password = System .getenv(" OSSRH_KEY" )
79+ }
80+ }
81+
82+ publications.withType<MavenPublication > {
83+ // Stub javadoc.jar artifact
84+ artifact(javadocJar.get())
85+
86+ // Provide artifacts information requited by Maven Central
87+ pom {
88+ name.set(" MOKO crash reporting" )
89+ description.set(" Fatal and Non-Fatal reporting to Crashlytics for Kotlin Multiplatform Mobile" )
90+ url.set(" https://github.com/icerockdev/moko-crash-reporting" )
91+ licenses {
92+ license {
93+ url.set(" https://github.com/icerockdev/moko-crash-reporting/blob/master/LICENSE.md" )
94+ }
95+ }
96+
97+ developers {
98+ developer {
99+ id.set(" Dorofeev" )
100+ name.set(" Andrey Dorofeev" )
101+ email.set(" adorofeev@icerockdev.com" )
102+ }
103+ developer {
104+ id.set(" Alex009" )
105+ name.set(" Aleksey Mikhailov" )
106+ email.set(" aleksey.mikhailov@icerockdev.com" )
107+ }
108+ }
109+
110+ scm {
111+ connection.set(" scm:git:ssh://github.com/icerockdev/moko-crash-reporting.git" )
112+ developerConnection.set(" scm:git:ssh://github.com/icerockdev/moko-crash-reporting.git" )
113+ url.set(" https://github.com/icerockdev/moko-crash-reporting" )
114+ }
115+ }
116+ }
117+
118+ apply (plugin = Deps .Plugins .signing.id)
119+
120+ configure<SigningExtension > {
121+ val signingKeyId: String? = System .getenv(" SIGNING_KEY_ID" )
122+ val signingPassword: String? = System .getenv(" SIGNING_PASSWORD" )
123+ val signingKey: String? = System .getenv(" SIGNING_KEY" )?.let { base64Key ->
124+ String (Base64 .getDecoder().decode(base64Key))
125+ }
126+ if (signingKeyId != null ) {
127+ useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
128+ sign(publications)
129+ }
130+ }
131+ }
132+ }
56133}
57134
58135tasks.register(" clean" , Delete ::class ).configure {
0 commit comments