blob: 4b1e3bde7f5be4f2baf7ddb19965afbac97c187f [file] [log] [blame]
Roman Elizarov1f74a2d2018-06-29 19:19:45 +03001/*
Vsevolod Tolstopyatove50a0fa2019-01-28 11:34:24 +03002 * Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
Roman Elizarov1f74a2d2018-06-29 19:19:45 +03003 */
Roman Elizarove1a56522018-04-04 10:31:08 +03004
5// Platform-specific configuration to compile JS modules
6
Vsevolod Tolstopyatove50a0fa2019-01-28 11:34:24 +03007apply plugin: 'kotlin2js'
Roman Elizarove1a56522018-04-04 10:31:08 +03008
Roman Elizarov31452902018-04-11 13:58:19 +03009dependencies {
10 compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
11 testCompile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version"
12}
13
Roman Elizarove1a56522018-04-04 10:31:08 +030014tasks.withType(compileKotlin2Js.getClass()) {
15 kotlinOptions {
16 moduleKind = "umd"
17 sourceMap = true
18 metaInfo = true
Roman Elizarov31452902018-04-11 13:58:19 +030019 }
20}
21
22compileKotlin2Js {
23 kotlinOptions {
Roman Elizarove1a56522018-04-04 10:31:08 +030024 // drop -js suffix from outputFile
25 def baseName = project.name - "-js"
26 outputFile = new File(outputFile.parent, baseName + ".js")
27 }
28}