Roman Elizarov | 1f74a2d | 2018-06-29 19:19:45 +0300 | [diff] [blame] | 1 | /* |
Vsevolod Tolstopyatov | 6d1a6e3 | 2020-02-18 15:28:00 +0300 | [diff] [blame] | 2 | * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. |
Roman Elizarov | 1f74a2d | 2018-06-29 19:19:45 +0300 | [diff] [blame] | 3 | */ |
Roman Elizarov | e1a5652 | 2018-04-04 10:31:08 +0300 | [diff] [blame] | 4 | |
| 5 | // Platform-specific configuration to compile JS modules |
| 6 | |
Victor Turansky | 964cd92 | 2020-05-02 19:52:56 +0300 | [diff] [blame] | 7 | apply plugin: 'org.jetbrains.kotlin.js' |
| 8 | |
Vsevolod Tolstopyatov | fcaa6df | 2020-08-24 18:57:22 +0300 | [diff] [blame] | 9 | dependencies { |
Vsevolod Tolstopyatov | fcaa6df | 2020-08-24 18:57:22 +0300 | [diff] [blame] | 10 | testImplementation "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version" |
Victor Turansky | 964cd92 | 2020-05-02 19:52:56 +0300 | [diff] [blame] | 11 | } |
Roman Elizarov | e1a5652 | 2018-04-04 10:31:08 +0300 | [diff] [blame] | 12 | |
Vsevolod Tolstopyatov | fcaa6df | 2020-08-24 18:57:22 +0300 | [diff] [blame] | 13 | kotlin { |
| 14 | js(LEGACY) { |
| 15 | moduleName = project.name - "-js" |
| 16 | } |
| 17 | |
| 18 | sourceSets { |
| 19 | main.kotlin.srcDirs = ['src'] |
| 20 | test.kotlin.srcDirs = ['test'] |
| 21 | main.resources.srcDirs = ['resources'] |
| 22 | test.resources.srcDirs = ['test-resources'] |
| 23 | } |
Roman Elizarov | 3145290 | 2018-04-11 13:58:19 +0300 | [diff] [blame] | 24 | } |
| 25 | |
Victor Turansky | 964cd92 | 2020-05-02 19:52:56 +0300 | [diff] [blame] | 26 | tasks.withType(compileKotlinJs.getClass()) { |
Roman Elizarov | e1a5652 | 2018-04-04 10:31:08 +0300 | [diff] [blame] | 27 | kotlinOptions { |
| 28 | moduleKind = "umd" |
| 29 | sourceMap = true |
| 30 | metaInfo = true |
Roman Elizarov | 3145290 | 2018-04-11 13:58:19 +0300 | [diff] [blame] | 31 | } |
| 32 | } |