committed by
Space Team
parent
492a161d2c
commit
9b4821be28
@@ -0,0 +1,55 @@
|
||||
import plugins.configureDefaultPublishing
|
||||
|
||||
plugins {
|
||||
`maven-publish`
|
||||
kotlin("js")
|
||||
}
|
||||
|
||||
val jsStdlibSources = "${projectDir}/../stdlib/js/src"
|
||||
|
||||
kotlin {
|
||||
js(IR) {
|
||||
sourceSets {
|
||||
val main by getting {
|
||||
kotlin.srcDir("$jsStdlibSources/org.w3c")
|
||||
kotlin.srcDir("$jsStdlibSources/kotlinx")
|
||||
kotlin.srcDir("$jsStdlibSources/kotlin/browser")
|
||||
kotlin.srcDir("$jsStdlibSources/kotlin/dom")
|
||||
|
||||
dependencies {
|
||||
api(project(":kotlin-stdlib-js"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile>().configureEach {
|
||||
compilerOptions.freeCompilerArgs
|
||||
.addAll(
|
||||
"-Xallow-kotlin-package",
|
||||
"-opt-in=kotlin.ExperimentalMultiplatform",
|
||||
"-opt-in=kotlin.contracts.ExperimentalContracts",
|
||||
// TODO: Better to use friendPaths property, but it does not work
|
||||
// KT-56690
|
||||
"-Xfriend-modules=${libraries.joinToString(File.pathSeparator) { it.absolutePath }}"
|
||||
)
|
||||
compilerOptions.allWarningsAsErrors.set(true)
|
||||
}
|
||||
|
||||
val emptyJavadocJar by tasks.creating(Jar::class) {
|
||||
archiveClassifier.set("javadoc")
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("maven") {
|
||||
from(components["kotlin"])
|
||||
}
|
||||
withType<MavenPublication> {
|
||||
artifact(emptyJavadocJar)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configureDefaultPublishing()
|
||||
@@ -0,0 +1 @@
|
||||
kotlin.js.compiler.publish.attribute=false
|
||||
@@ -59,6 +59,10 @@ val jsMainSources by task<Sync> {
|
||||
val excluded = listOf(
|
||||
// stdlib/js/src/generated is used exclusively for current `js-v1` backend.
|
||||
"libraries/stdlib/js/src/generated/**",
|
||||
"libraries/stdlib/js/src/kotlin/browser",
|
||||
"libraries/stdlib/js/src/kotlin/dom",
|
||||
"libraries/stdlib/js/src/org.w3c",
|
||||
"libraries/stdlib/js/src/kotlinx",
|
||||
|
||||
// JS-specific optimized version of emptyArray() already defined
|
||||
"core/builtins/src/kotlin/ArrayIntrinsics.kt"
|
||||
|
||||
@@ -334,6 +334,7 @@ tasks.withType<Test> {
|
||||
dependsOn(":gradle:android-test-fixes:install")
|
||||
dependsOn(":gradle:gradle-warnings-detector:install")
|
||||
dependsOn(":examples:annotation-processor-example:install")
|
||||
dependsOn(":kotlin-dom-api-compat:install")
|
||||
|
||||
systemProperty("kotlinVersion", rootProject.extra["kotlinVersion"] as String)
|
||||
systemProperty("runnerGradleVersion", gradle.gradleVersion)
|
||||
|
||||
Reference in New Issue
Block a user