blob: 579eab559b985339eccd774d5c03ca258cca4b99 [file] [log] [blame]
/*
* Copyright 2017-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
kotlin {
targets {
fromPreset(presets.jvm, 'jvm') {
withJava()
configure([compilations.main, compilations.test]) {
kotlinOptions {
jvmTarget = '1.6'
}
}
}
}
js {
nodejs {}
configure([compilations.main, compilations.test]) {
kotlinOptions {
sourceMap = true
moduleKind = "umd"
metaInfo = true
}
}
}
sourceSets.all {
kotlin.srcDirs = ["$it.name/src"]
resources.srcDirs = ["$it.name/resources"]
languageSettings {
progressiveMode = true
useExperimentalAnnotation("kotlin.Experimental")
useExperimentalAnnotation("kotlin.ExperimentalMultiplatform")
useExperimentalAnnotation("kotlin.ExperimentalStdlibApi")
useExperimentalAnnotation("kotlinx.serialization.InternalSerializationApi")
}
}
sourceSets {
commonMain {
dependencies {
api 'org.jetbrains.kotlin:kotlin-stdlib-common'
}
}
commonTest {
dependencies {
api 'org.jetbrains.kotlin:kotlin-test-common'
api 'org.jetbrains.kotlin:kotlin-test-annotations-common'
}
}
jvmMain {
dependencies {
api 'org.jetbrains.kotlin:kotlin-stdlib'
}
}
jvmTest {
dependencies {
api 'org.jetbrains.kotlin:kotlin-test-junit'
}
}
jsMain {
dependencies {
api 'org.jetbrains.kotlin:kotlin-stdlib-js'
}
}
jsTest {
dependencies {
api 'org.jetbrains.kotlin:kotlin-test-js'
}
}
nativeMain.dependencies {
}
}
sourceSets.findAll({ it.name.contains("Test") }).forEach { srcSet ->
srcSet.languageSettings {
it.useExperimentalAnnotation("kotlinx.serialization.InternalSerializationApi")
}
}
sourceSets.matching({ it.name.contains("Main") }).all { srcSet ->
project.ext.set("kotlin.mpp.freeCompilerArgsForSourceSet.${srcSet.name}", "-Xexplicit-api=warning")
}
}