@@ -2,6 +2,7 @@ package plugins
2
2
3
3
import common.*
4
4
import common.libs
5
+ import nmcp.NmcpPublishTask
5
6
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeLink
6
7
7
8
plugins {
@@ -97,23 +98,22 @@ publishing {
97
98
}
98
99
}
99
100
100
- nmcp {
101
- publishAllPublications {
102
- username = mavenCentralUsername
103
- password = mavenCentralPassword
104
- }
105
- }
106
-
107
101
signing {
108
102
setRequired { hasSigningKey }
109
103
if (hasSigningKey) {
110
104
useInMemoryPgpKeys(signingKeyId.orNull, signingKey.orNull, signingPassword.orNull)
111
- // useGpgCmd()
112
105
}
113
106
sign(publishing.publications)
114
107
// gradle.taskGraph.allTasks.any { it.name.startsWith("publish") }
115
108
}
116
109
110
+ nmcp {
111
+ publishAllPublications {
112
+ username = mavenCentralUsername
113
+ password = mavenCentralPassword
114
+ }
115
+ }
116
+
117
117
fun MavenPublication.configurePom () {
118
118
pom {
119
119
name = provider { " ${project.group} :${project.name} " }
@@ -149,7 +149,10 @@ tasks {
149
149
// Suppressing publication validation errors
150
150
withType<GenerateModuleMetadata > { suppressedValidationErrors.add(" enforced-platform" ) }
151
151
152
- withType<Sign >().configureEach { onlyIf { hasSigningKey } }
152
+ // For maven central portal publications (Might need fix in nmcp)
153
+ withType<NmcpPublishTask >().configureEach { mustRunAfter(withType<Sign >()) }
154
+
155
+ withType<PublishToMavenRepository >().configureEach { mustRunAfter(withType<Sign >()) }
153
156
154
157
// For publishing kotlin native binaries
155
158
withType<PublishToMavenRepository >().configureEach { mustRunAfter(withType<KotlinNativeLink >()) }
0 commit comments