forked from JetBrains/kotlin-wrappers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
50 lines (44 loc) · 1.36 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile
import org.jetbrains.kotlin.gradle.dsl.KotlinJsProjectExtension
import org.jetbrains.kotlin.gradle.plugin.KotlinJsPluginWrapper
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
plugins {
kotlin("js") apply false
}
subprojects {
repositories {
jcenter()
maven("https://kotlin.bintray.com/kotlinx")
maven("https://kotlin.bintray.com/kotlin-js-wrappers")
maven("https://kotlin.bintray.com/kotlin-eap")
maven("https://kotlin.bintray.com/kotlin-dev")
}
plugins.withType<KotlinJsPluginWrapper> {
extensions.configure<KotlinJsProjectExtension> {
js {
browser()
}
}
tasks.withType<KotlinJsCompile>().configureEach {
kotlinOptions {
if (name == "compileKotlinJs") {
outputFile = jsOutputFile
sourceMapEmbedSources = "always"
sourceMap = true
} else {
sourceMap = false
}
}
}
}
afterEvaluate {
tasks.withType<KotlinCompile<*>>().configureEach {
if (!name.endsWith("JsIr")) {
kotlinOptions.allWarningsAsErrors = true
}
}
}
}
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}