Skip to content

Commit

Permalink
central portal for publishing (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
psuzn authored Apr 17, 2024
1 parent 544a5af commit 67fad5e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
10 changes: 8 additions & 2 deletions build-logic/src/main/kotlin/PackagingConventionPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
* limitations under the License.
*/

import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import me.sujanpoudel.utils.apply
import me.sujanpoudel.utils.libs
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.kotlin.dsl.findByType
import org.gradle.kotlin.dsl.getByType
import org.gradle.kotlin.dsl.withType
import org.gradle.plugins.signing.SigningExtension
Expand All @@ -36,6 +37,11 @@ class PackagingConventionPlugin : Plugin<Project> {
}

configurePublishingMetadata()

extensions.getByType<MavenPublishBaseExtension>().apply {
signAllPublications()
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
}
}
}

Expand Down Expand Up @@ -72,7 +78,7 @@ fun Project.configurePublishingMetadata(): PublishingExtension = extensions.getB
}
}

extensions.findByType<SigningExtension>()?.apply {
extensions.getByType<SigningExtension>().apply {
isRequired = true
}
}
4 changes: 0 additions & 4 deletions context-provider/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.vanniktech.maven.publish.SonatypeHost

plugins {
id("module")
Expand Down Expand Up @@ -47,9 +46,6 @@ android {
}

mavenPublishing {
signAllPublications()
publishToMavenCentral(SonatypeHost.S01)

pom {
name.set("Platform Identifier")
description.set("Get android context anywhere on your android source-set.")
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ kotlin = "1.9.23"
agp = "8.2.2"
compose = "1.6.1"
klint-plugin = "12.0.3"
mavenPublish = "0.25.3"
mavenPublish = "0.28.0"
detekt = "1.23.6"

# libraries
Expand Down
6 changes: 1 addition & 5 deletions multiplatform-paths/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.vanniktech.maven.publish.SonatypeHost

plugins {
id("packaging")
Expand Down Expand Up @@ -78,11 +77,8 @@ kotlin {

@Suppress("ktlint:standard:max-line-length")
mavenPublishing {
signAllPublications()
publishToMavenCentral(SonatypeHost.S01)

pom {
name.set("Paths")
name.set("Multiplatform Paths")
description.set(
"Get platform specific app data and cache directory(equivalent to ApplicationInfo.dataDir or NSHomeDirectory) in Kotlin Multiplatform application",
)
Expand Down
4 changes: 0 additions & 4 deletions platform-identifier/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.vanniktech.maven.publish.SonatypeHost

plugins {
id("packaging")
Expand Down Expand Up @@ -82,9 +81,6 @@ android {
}

mavenPublishing {
signAllPublications()
publishToMavenCentral(SonatypeHost.S01)

pom {
name.set("Platform Identifier")
description.set("Identify the current platform in Kotlin Multiplatform application")
Expand Down

0 comments on commit 67fad5e

Please sign in to comment.