-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
51 lines (44 loc) · 1.27 KB
/
build.gradle
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
51
group 'test'
version '1.0-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.2.0'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin2js'
build.doLast {
// Copy kotlin library files to the dist directory
// Copy kotlin.js and kotlin-meta.js from jar into dist directory
configurations.compile.each { File file ->
copy {
includeEmptyDirs = false
from zipTree(file.absolutePath)
into "${projectDir}/dist"
include { fileTreeElement ->
def path = fileTreeElement.path
path.endsWith(".js") && (path.startsWith("META-INF/resources/") || !path.startsWith("META-INF/"))
}
}
}
// Copy static resources to the dist directory
copy {
includeEmptyDirs = false
from "${buildDir}/resources/main"
into "${projectDir}/dist"
}
}
// Delete the dist directory as part of the clean command
clean.doFirst {
delete "${projectDir}/dist"
}
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
compile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.19.3'
}