| import org.gradle.kotlin.dsl.support.serviceOf | |
| import plugins.configureDefaultPublishing | |
| import plugins.configureKotlinPomAttributes | |
| description = "Runtime library for the JS Plain Objects compiler plugin" | |
| plugins { | |
| id("common-configuration") | |
| id("com.autonomousapps.dependency-analysis") | |
| kotlin("multiplatform") | |
| `maven-publish` | |
| id("nodejs-configuration") | |
| } | |
| group = "org.jetbrains.kotlin" | |
| val buildFeatures = serviceOf<BuildFeatures>() | |
| kotlin { | |
| js { | |
| if (!buildFeatures.isolatedProjects.active.get()) { | |
| browser() | |
| nodejs() | |
| } | |
| } | |
| sourceSets { | |
| jsMain { | |
| dependencies { | |
| compileOnly(project(":kotlin-stdlib")) | |
| } | |
| } | |
| } | |
| } | |
| val emptyJavadocJar = tasks.register("emptyJavadocJar", Jar::class) { | |
| archiveClassifier.set("javadoc") | |
| } | |
| configureDefaultPublishing() | |
| publishing { | |
| publications { | |
| create<MavenPublication>("maven") { | |
| artifactId = "kotlin-js-plain-objects" | |
| // FIXME: Remove customized publication in KT-83065 | |
| from(kotlin.js().components.single()) | |
| configureKotlinPomAttributes(project, "Annotations library for the JS Plain Objects compiler plugin", packaging = "klib") | |
| } | |
| withType<MavenPublication> { | |
| artifact(emptyJavadocJar) | |
| } | |
| } | |
| } |