-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
53 lines (45 loc) · 1.14 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
52
53
plugins{
id "kotlin2js" version "1.3.21"
id 'kotlinx-serialization' version '1.3.21'
id "org.jetbrains.kotlin.frontend" version "0.0.45"
}
group 'kotlin-poc-frontend-ktor-client'
version '1.0-SNAPSHOT'
ext{
web_dir = "web"
}
repositories {
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-js"
compile "org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:0.10.0"
compile "io.ktor:ktor-client-js:1.1.3"
compile "io.ktor:ktor-client-json-js:1.1.3"
}
kotlinFrontend {
npm{
dependency "text-encoding"
}
webpackBundle {
contentPath = file('src/main/resources/web')
if (project.hasProperty('prod')) {
mode = "production"
}
}
}
clean.doFirst() {
delete("${web_dir}")
}
bundle.doLast() {
copy {
from "${buildDir}/resources/main/web"
from "${buildDir}/bundle"
into "${web_dir}"
}
}
compileKotlin2Js {
kotlinOptions.moduleKind = 'commonjs'
kotlinOptions.freeCompilerArgs += ['-Xuse-experimental=kotlinx.serialization.ImplicitReflectionSerializer']
}