@@ -32,7 +32,7 @@ buildscript {
32
32
}
33
33
34
34
group = " com.adamratzman"
35
- version = " 3.4.03 "
35
+ version = " 3.5.0-rc.1 "
36
36
37
37
tasks.withType<Test > {
38
38
this .testLogging {
@@ -94,7 +94,6 @@ kotlin {
94
94
}
95
95
96
96
mavenPublication {
97
- artifactId = " spotify-api-kotlin-android"
98
97
setupPom(artifactId)
99
98
}
100
99
@@ -112,14 +111,12 @@ kotlin {
112
111
}
113
112
114
113
mavenPublication {
115
- artifactId = " spotify-api-kotlin"
116
114
setupPom(artifactId)
117
115
}
118
116
}
119
117
120
118
js(KotlinJsCompilerType .LEGACY ) {
121
119
mavenPublication {
122
- artifactId = " spotify-api-kotlin-js"
123
120
setupPom(artifactId)
124
121
}
125
122
@@ -147,11 +144,65 @@ kotlin {
147
144
}
148
145
149
146
val hostOs = System .getProperty(" os.name" )
147
+ val isMainHost = hostOs.contains(" mac" , true )
148
+ // val isMainPlatform =
150
149
val isMingwX64 = hostOs.startsWith(" Windows" )
151
150
152
- macosX64()
153
- linuxX64()
154
- mingwX64()
151
+ macosX64 {
152
+ mavenPublication {
153
+ setupPom(artifactId)
154
+ }
155
+ }
156
+ linuxX64 {
157
+ mavenPublication {
158
+ setupPom(artifactId)
159
+ }
160
+ }
161
+ mingwX64 {
162
+ mavenPublication {
163
+ setupPom(artifactId)
164
+ }
165
+ }
166
+
167
+ val publicationsFromMainHost =
168
+ listOf (jvm(), js()).map { it.name } + " kotlinMultiplatform"
169
+
170
+ publishing {
171
+ publications {
172
+ matching { it.name in publicationsFromMainHost }.all {
173
+ val targetPublication = this @all
174
+ tasks.withType<AbstractPublishToMaven >()
175
+ .matching { it.publication == targetPublication }
176
+ .configureEach { onlyIf { findProperty(" isMainHost" ) == " true" } }
177
+ }
178
+
179
+ val kotlinMultiplatform by getting(MavenPublication ::class ) {
180
+ artifactId = " spotify-api-kotlin-core"
181
+ setupPom(artifactId)
182
+ }
183
+
184
+ /* val metadata by getting(MavenPublication::class) {
185
+ artifactId = "spotify-api-kotlin-metadata"
186
+ setupPom(artifactId)
187
+ }*/
188
+ }
189
+
190
+ repositories {
191
+ maven {
192
+ name = " nexus"
193
+ val releasesRepoUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
194
+ val snapshotsRepoUrl = " https://oss.sonatype.org/content/repositories/snapshots/"
195
+ url = uri(if (version.toString().endsWith(" SNAPSHOT" )) snapshotsRepoUrl else releasesRepoUrl)
196
+
197
+ credentials {
198
+ val nexusUsername: String? by project.extra
199
+ val nexusPassword: String? by project.extra
200
+ username = nexusUsername
201
+ password = nexusPassword
202
+ }
203
+ }
204
+ }
205
+ }
155
206
156
207
targets {
157
208
sourceSets {
@@ -276,35 +327,6 @@ kotlin {
276
327
}
277
328
}
278
329
279
- publishing {
280
- publications {
281
- val kotlinMultiplatform by getting(MavenPublication ::class ) {
282
- artifactId = " spotify-api-kotlin-core"
283
- setupPom(artifactId)
284
- }
285
-
286
- /* val metadata by getting(MavenPublication::class) {
287
- artifactId = "spotify-api-kotlin-metadata"
288
- setupPom(artifactId)
289
- }*/
290
- }
291
-
292
- repositories {
293
- maven {
294
- name = " nexus"
295
- val releasesRepoUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
296
- val snapshotsRepoUrl = " https://oss.sonatype.org/content/repositories/snapshots/"
297
- url = uri(if (version.toString().endsWith(" SNAPSHOT" )) snapshotsRepoUrl else releasesRepoUrl)
298
-
299
- credentials {
300
- val nexusUsername: String? by project.extra
301
- val nexusPassword: String? by project.extra
302
- username = nexusUsername
303
- password = nexusPassword
304
- }
305
- }
306
- }
307
- }
308
330
309
331
signing {
310
332
if (project.hasProperty(" signing.keyId" )
@@ -382,3 +404,4 @@ fun MavenPublication.setupPom(publicationName: String) {
382
404
}
383
405
}
384
406
}
407
+
0 commit comments