-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
82 lines (74 loc) · 2.35 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
76
77
78
79
80
81
82
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.21"
}
}
apply plugin: 'kotlin-multiplatform'
kotlin {
targets {
js('frontend', IR) {
browser {
testTask {
enabled = false
}
distribution {
directory = file("$projectDir/src/backendMain/resources/web")
}
binaries.executable()
webpackTask {
outputFileName = "chat.js"
}
runTask {
outputFileName = "chat.js"
}
}
}
jvm('backend')
}
sourceSets.each {
it.dependencies {
implementation(project.dependencies.enforcedPlatform("io.ktor:ktor-bom:2.3.11"))
}
}
sourceSets {
backendMain {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.21"
implementation "io.ktor:ktor-server-netty"
implementation "io.ktor:ktor-server-websockets"
implementation "io.ktor:ktor-server-call-logging"
implementation "io.ktor:ktor-server-default-headers"
implementation "io.ktor:ktor-server-sessions"
implementation "ch.qos.logback:logback-classic:1.4.6"
}
}
backendTest {
dependencies {
implementation "io.ktor:ktor-server-test-host"
implementation "io.ktor:ktor-client-websockets"
implementation "org.jetbrains.kotlin:kotlin-test"
}
}
frontendMain {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-js"
implementation "io.ktor:ktor-client-websockets"
implementation "io.ktor:ktor-client-js"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:1.6.4"
}
}
}
}
repositories {
mavenCentral()
}
tasks.register("run", JavaExec) {
dependsOn(frontendBrowserDistribution)
dependsOn(backendMainClasses)
mainClass.set("io.ktor.samples.chat.backend.ChatApplicationKt")
classpath(configurations.backendRuntimeClasspath, backendJar)
args = []
}