1
1
import com.vanniktech.maven.publish.SonatypeHost
2
- import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
3
- import org.jetbrains.kotlin.konan.target.KonanTarget
4
- import org.jetbrains.kotlin.konan.util.DependencyDirectories.localKonanDir
2
+
5
3
// import pl.lemanski.plugin.KonanPluginExtension
6
4
7
5
plugins {
8
6
alias(libs.plugins.kotlinMultiplatform)
9
7
alias(libs.plugins.androidLibrary)
10
8
alias(libs.plugins.maven.publish)
11
9
// id("pl.lemanski.plugin")
12
- `maven- publish`
13
10
signing
14
11
}
15
12
@@ -93,63 +90,57 @@ kotlin {
93
90
// }?.absolutePath
94
91
// }
95
92
96
- //
93
+ // Publishing
97
94
98
- publishing {
99
- repositories {
100
- maven {
101
- name = " MavenCentral"
95
+ mavenPublishing {
96
+ publishToMavenCentral(SonatypeHost .CENTRAL_PORTAL )
102
97
103
- setUrl {
104
- uri(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" )
105
- }
98
+ coordinates(
99
+ groupId = group.toString(),
100
+ artifactId = " soundfont" ,
101
+ version = version.toString()
102
+ )
106
103
107
- credentials {
108
- username = System .getenv(" MAVEN_CENTRAL_USERNAME" )
109
- password = System .getenv(" MAVEN_CENTRAL_PASSWORD" )
110
- }
104
+ println (SonatypeHost .DEFAULT .toString())
105
+
106
+ pom {
107
+ name.set(" MikroSoundFont" )
108
+ description.set(" Kotlin Multiplatform library for sample-based synthesis to play MIDI files." )
109
+ inceptionYear.set(" 2024" )
110
+ url.set(" https://github.com/lemcoder/MikroSoundFont" )
111
111
112
- authentication {
113
- create<BasicAuthentication >(" basic" )
112
+ licenses {
113
+ license {
114
+ name.set(" Apache-2.0 license" )
115
+ url.set(" https://www.apache.org/licenses/LICENSE-2.0" )
114
116
}
115
117
}
116
- }
117
118
118
- publications {
119
- withType<MavenPublication > {
120
- pom {
121
- name.set(" MikroSoundFont" )
122
- description.set(" Kotlin Multiplatform library for sample-based synthesis to play MIDI files." )
123
- inceptionYear.set(" 2024" )
124
- url.set(" https://github.com/lemcoder/MikroSoundFont" )
125
-
126
- licenses {
127
- license {
128
- name.set(" Apache-2.0 license" )
129
- url.set(" https://www.apache.org/licenses/LICENSE-2.0" )
130
- }
131
- }
132
-
133
- developers {
134
- developer {
135
- id.set(" lemcoder" )
136
- name.set(" Mikołaj Lemański" )
137
-
138
- }
139
- }
140
-
141
- scm {
142
- url.set(" https://github.com/lemcoder/MikroSoundFont" )
143
- }
119
+ developers {
120
+ developer {
121
+ id.set(" lemcoder" )
122
+ name.set(" Mikołaj Lemański" )
123
+
144
124
}
145
125
}
126
+
127
+ scm {
128
+ url.set(" https://github.com/lemcoder/MikroSoundFont" )
129
+ }
146
130
}
147
131
}
148
132
133
+ // Sign with default plugin
149
134
signing {
150
135
useInMemoryPgpKeys(
151
136
System .getenv(" SIGNING_KEY" ),
152
137
System .getenv(" SIGNING_KEY_PASSWORD" )
153
138
)
154
139
sign(publishing.publications)
140
+
141
+ // Temporary workaround, see https://github.com/gradle/gradle/issues/26091#issuecomment-1722947958
142
+ tasks.withType<AbstractPublishToMaven >().configureEach {
143
+ val signingTasks = tasks.withType<Sign >()
144
+ mustRunAfter(signingTasks)
145
+ }
155
146
}
0 commit comments