Skip to content

Commit

Permalink
fix signing applying bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjenx committed Oct 30, 2024
1 parent 576b9de commit 57f54af
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
27 changes: 13 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.MavenPublishPlugin
import com.vanniktech.maven.publish.MavenPublishBasePlugin
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
alias(libs.plugins.multiplatform).apply(false)
alias(libs.plugins.android.library).apply(false)
alias(libs.plugins.multiplatform).apply(false)
alias(libs.plugins.kotlinx.serialization).apply(false)
alias(libs.plugins.sqlDelight).apply(false)
alias(libs.plugins.maven.publish).apply(false)
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.maven.publish).apply(false)
}

group = findProperty("GROUP").toString()
Expand All @@ -23,13 +23,19 @@ allprojects {
}

subprojects {
plugins.withType<MavenPublishPlugin>().configureEach {
extensions.findByType<PublishingExtension>()?.also { publishing ->
plugins.withType<MavenPublishBasePlugin>().configureEach {
extensions.configure<MavenPublishBaseExtension> {
logger.lifecycle("Configuring Maven Publishing for ${name}:${version}")
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = true)
// https://github.com/vanniktech/gradle-maven-publish-plugin/issues/865
//signAllPublications()
}
extensions.configure<PublishingExtension> {
logger.lifecycle("Publishing ${project.name}:${version}")
publishing.publications.withType<MavenPublication>().configureEach {
publications.withType<MavenPublication>().configureEach {
this.version = project.version.toString()
}
publishing.repositories {
repositories {
// GitHub Packages
maven {
name = "GitHubPackages"
Expand All @@ -41,13 +47,6 @@ subprojects {
}
}
}
extensions.findByType<MavenPublishBaseExtension>()?.also { mavenPublishing ->
mavenPublishing.publishToMavenCentral(
SonatypeHost.CENTRAL_PORTAL,
automaticRelease = true
)
mavenPublishing.signAllPublications()
}
}
tasks.withType<KotlinCompile>().configureEach {
compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes")
Expand Down
5 changes: 5 additions & 0 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,8 @@ androidComponents {
(it as HasUnitTestBuilder).enableUnitTest = false
}
}

// https://github.com/vanniktech/gradle-maven-publish-plugin/issues/865
mavenPublishing {
signAllPublications()
}

0 comments on commit 57f54af

Please sign in to comment.