Skip to content

Commit

Permalink
Merge pull request #122 from icerockdev/#120-fix-publication
Browse files Browse the repository at this point in the history
#120 fix publication
  • Loading branch information
Alex009 authored Apr 2, 2021
2 parents 8cbd311 + 7a8fae1 commit 5972b09
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 81 deletions.
100 changes: 52 additions & 48 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
*/

import java.util.Base64
import kotlin.text.String

plugins {
plugin(Deps.Plugins.detekt) apply false
plugin(Deps.Plugins.dokka) apply false
plugin(Deps.Plugins.mavenPublish)
plugin(Deps.Plugins.signing)
}

buildscript {
Expand Down Expand Up @@ -57,62 +54,69 @@ allprojects {
}
}
}
}

val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}

publishing {
repositories.maven("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
name = "OSSRH"
plugins.withId(Deps.Plugins.mavenPublish.id) {
group = "dev.icerock.moko"
version = Deps.mokoMvvmVersion

credentials {
username = System.getenv("OSSRH_USER")
password = System.getenv("OSSRH_KEY")
val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}
}

publications.withType<MavenPublication> {
// Stub javadoc.jar artifact
artifact(javadocJar.get())

// Provide artifacts information requited by Maven Central
pom {
name.set("MOKO mvvm")
description.set("Model-View-ViewModel architecture components for mobile (android & ios) Kotlin Multiplatform development")
url.set("https://github.com/icerockdev/moko-mvvm")
licenses {
license {
url.set("https://github.com/icerockdev/moko-mvvm/blob/master/LICENSE.md")
configure<PublishingExtension> {
repositories.maven("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
name = "OSSRH"

credentials {
username = System.getenv("OSSRH_USER")
password = System.getenv("OSSRH_KEY")
}
}

developers {
developer {
id.set("Alex009")
name.set("Aleksey Mikhailov")
email.set("aleksey.mikhailov@icerockdev.com")
publications.withType<MavenPublication> {
// Stub javadoc.jar artifact
artifact(javadocJar.get())

// Provide artifacts information requited by Maven Central
pom {
name.set("MOKO mvvm")
description.set("Model-View-ViewModel architecture components for mobile (android & ios) Kotlin Multiplatform development")
url.set("https://github.com/icerockdev/moko-mvvm")
licenses {
license {
url.set("https://github.com/icerockdev/moko-mvvm/blob/master/LICENSE.md")
}
}

developers {
developer {
id.set("Alex009")
name.set("Aleksey Mikhailov")
email.set("aleksey.mikhailov@icerockdev.com")
}
}

scm {
connection.set("scm:git:ssh://github.com/icerockdev/moko-mvvm.git")
developerConnection.set("scm:git:ssh://github.com/icerockdev/moko-mvvm.git")
url.set("https://github.com/icerockdev/moko-mvvm")
}
}
}

scm {
connection.set("scm:git:ssh://github.com/icerockdev/moko-mvvm.git")
developerConnection.set("scm:git:ssh://github.com/icerockdev/moko-mvvm.git")
url.set("https://github.com/icerockdev/moko-mvvm")
}
}
}
apply(plugin = Deps.Plugins.signing.id)

signing {
val signingKeyId: String? = System.getenv("SIGNING_KEY_ID")
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
val signingKey: String? = System.getenv("SIGNING_KEY")?.let { base64Key ->
String(Base64.getDecoder().decode(base64Key))
}
if (signingKeyId != null) {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publishing.publications)
configure<SigningExtension> {
val signingKeyId: String? = System.getenv("SIGNING_KEY_ID")
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
val signingKey: String? = System.getenv("SIGNING_KEY")?.let { base64Key ->
String(Base64.getDecoder().decode(base64Key))
}
if (signingKeyId != null) {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publications)
}
}
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions mvvm-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ plugins {
plugin(Deps.Plugins.mavenPublish)
}

group = "dev.icerock.moko"
version = Deps.mokoMvvmVersion

dependencies {
commonMainImplementation(Deps.Libs.MultiPlatform.coroutines)

Expand Down
3 changes: 0 additions & 3 deletions mvvm-databinding/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ plugins {
plugin(Deps.Plugins.mavenPublish)
}

group = "dev.icerock.moko"
version = Deps.mokoMvvmVersion

android {
buildFeatures.dataBinding = true

Expand Down
3 changes: 0 additions & 3 deletions mvvm-livedata-glide/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ plugins {
plugin(Deps.Plugins.mavenPublish)
}

group = "dev.icerock.moko"
version = Deps.mokoMvvmVersion

android {
sourceSets.all { java.srcDir("src/$name/kotlin") }
}
Expand Down
3 changes: 0 additions & 3 deletions mvvm-livedata-material/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ plugins {
plugin(Deps.Plugins.mavenPublish)
}

group = "dev.icerock.moko"
version = Deps.mokoMvvmVersion

android {
sourceSets.all { java.srcDir("src/$name/kotlin") }
}
Expand Down
3 changes: 0 additions & 3 deletions mvvm-livedata-swiperefresh/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ plugins {
plugin(Deps.Plugins.mavenPublish)
}

group = "dev.icerock.moko"
version = Deps.mokoMvvmVersion

android {
sourceSets.all { java.srcDir("src/$name/kotlin") }
}
Expand Down
3 changes: 0 additions & 3 deletions mvvm-livedata/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ plugins {
plugin(Deps.Plugins.mavenPublish)
}

group = "dev.icerock.moko"
version = Deps.mokoMvvmVersion

dependencies {
commonMainImplementation(Deps.Libs.MultiPlatform.coroutines)

Expand Down
3 changes: 0 additions & 3 deletions mvvm-state-deprecated/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ plugins {
plugin(Deps.Plugins.mavenPublish)
}

group = "dev.icerock.moko"
version = Deps.mokoMvvmVersion

dependencies {
commonMainImplementation(Deps.Libs.MultiPlatform.coroutines)

Expand Down
3 changes: 0 additions & 3 deletions mvvm-state/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ plugins {
plugin(Deps.Plugins.mavenPublish)
}

group = "dev.icerock.moko"
version = Deps.mokoMvvmVersion

dependencies {
commonMainImplementation(Deps.Libs.MultiPlatform.coroutines)

Expand Down
3 changes: 0 additions & 3 deletions mvvm-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ plugins {
plugin(Deps.Plugins.mavenPublish)
}

group = "dev.icerock.moko"
version = Deps.mokoMvvmVersion

dependencies {
commonMainApi(Deps.Libs.MultiPlatform.coroutines)

Expand Down
3 changes: 0 additions & 3 deletions mvvm-viewbinding/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ plugins {
plugin(Deps.Plugins.mavenPublish)
}

group = "dev.icerock.moko"
version = Deps.mokoMvvmVersion

android {
buildFeatures.viewBinding = true

Expand Down
3 changes: 0 additions & 3 deletions mvvm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ plugins {
plugin(Deps.Plugins.mavenPublish)
}

group = "dev.icerock.moko"
version = Deps.mokoMvvmVersion

dependencies {
// by default use old named state
// core and livedata loaded transitive from it. not add directly - mergeDex will fail on android
Expand Down

0 comments on commit 5972b09

Please sign in to comment.