@@ -279,6 +279,10 @@ if (isReleaseBuild) {
279
279
}
280
280
deploy {
281
281
maven {
282
+ pomchecker {
283
+ failOnError = false
284
+ failOnWarning = false
285
+ }
282
286
mavenCentral {
283
287
create(" maven-central" ) {
284
288
applyMavenCentralRules = false // Already checked
@@ -287,6 +291,18 @@ if (isReleaseBuild) {
287
291
url = " https://central.sonatype.com/api/v1/publisher"
288
292
maxRetries = 240
289
293
stagingRepository(stagingDeployDir.path)
294
+
295
+ // kotlin.targets.forEach { target ->
296
+ // if (target !is org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget) {
297
+ // artifactOverride {
298
+ // groupId = groupId
299
+ // //artifactId =
300
+ // //verifyPom = false
301
+ // jar = false
302
+ // }
303
+ // }
304
+ // }
305
+
290
306
}
291
307
}
292
308
}
@@ -339,3 +355,51 @@ fun MavenPom.setUpPomDetails() {
339
355
}
340
356
}
341
357
}
358
+
359
+
360
+ tasks.register(" listArtifacts" ) {
361
+ doLast {
362
+ kotlin.targets.forEach { target ->
363
+ println (" Target: ${target.name} " )
364
+
365
+ // Get all binary artifacts
366
+ target.compilations.forEach { compilation ->
367
+ println (" Compilation: ${compilation.name} " )
368
+
369
+ // Get the output file/directory for this compilation
370
+ when (target) {
371
+ is org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget -> {
372
+ val jarTask = tasks.findByName(" ${target.name} Jar" ) as ? org.gradle.api.tasks.bundling.Jar
373
+ println (" Output: ${jarTask?.archiveFileName?.get() ? : " N/A" } (JAR)" )
374
+ }
375
+
376
+ is org.jetbrains.kotlin.gradle.targets.js.KotlinJsTarget -> {
377
+ val jsTask = tasks.findByName(" ${compilation.name} ProductionExecutable" ) as ? org.gradle.api.Task
378
+ println (" Output: ${jsTask?.outputs?.files?.singleFile?.name ? : " N/A" } (JS Bundle)" )
379
+ }
380
+
381
+ // is org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget -> {
382
+ // val klib = target.binaries.findKlibs(compilation)
383
+ // println(" KLIB: ${klib.map { it.outputFile.name }.joinToString() ?: "N/A"}")
384
+ //
385
+ // // Print executables/frameworks
386
+ // target.binaries.forEach { binary ->
387
+ // println(" Binary: ${binary.outputFile.name} (${binary.javaClass.simpleName})")
388
+ // }
389
+ // }
390
+
391
+ else -> println (" Unknown target type: ${target.javaClass.simpleName} " )
392
+ }
393
+ }
394
+ println ()
395
+ }
396
+ }
397
+ }
398
+
399
+ // // Helper function to find KLIBs for a compilation
400
+ // fun org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeBinaryContainer.findKlibs(
401
+ // compilation: org.jetbrains.kotlin.gradle.plugin.KotlinCompilation<*>
402
+ // ): List<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeLibrary> {
403
+ // return filterIsInstance<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeLibrary>()
404
+ // .filter { it.compilation == compilation }
405
+ // }
0 commit comments