-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
75 lines (65 loc) · 2.54 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
plugins {
id 'org.jetbrains.kotlin.multiplatform' version '1.3.21'
}
apply plugin: 'kotlin-dce-js' //apply the dce plugin which gets rid of dead code in kotlin
repositories {
maven { url 'http://dl.bintray.com/kotlin/kotlinx.html' }
maven { url 'http://dl.bintray.com/kotlin/kotlin-eap' }
maven { url 'http://dl.bintray.com/kotlin/kotlin-js-wrappers' }
maven { url 'http://dl.bintray.com/kotlin/kotlinx' }
mavenCentral()
jcenter()
}
kotlin {
targets {
fromPreset(presets.jvm, 'jvm')
configure(fromPreset(presets.js, 'js')) { //needed to configure the JS target
tasks.getByName(compilations.main.compileKotlinTaskName).kotlinOptions {
sourceMap = true //create source maps for js files
sourceMapEmbedSources = "always" //embed the kotlin files into the sourcemaps for viewing in the browser
moduleKind = 'commonjs' //module type to be loaded by webpack
}
}
}
sourceSets {
commonMain {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-common'
}
}
commonTest {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-test-common'
implementation 'org.jetbrains.kotlin:kotlin-test-annotations-common'
}
}
jvmMain {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
implementation "io.ktor:ktor-server-core:1.0.0"
implementation "io.ktor:ktor-server-netty:1.0.0"
implementation "io.ktor:ktor-jackson:1.0.0"
implementation "com.fasterxml.jackson.core:jackson-core:2.9.7"
}
}
jvmTest {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-test'
implementation 'org.jetbrains.kotlin:kotlin-test-junit'
}
}
jsMain {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-js'
implementation 'org.jetbrains:kotlin-react:16.5.2-pre.55-kotlin-1.2.71'
implementation 'org.jetbrains:kotlin-react-dom:16.5.2-pre.55-kotlin-1.2.71'
implementation 'org.jetbrains:kotlin-react-router-dom:4.3.1-pre.55-kotlin-1.2.71'
}
}
jsTest {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-test-js'
}
}
}
}