1
+ /*
2
+ * Copyright 2015-2022 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
1
17
import org.jetbrains.kotlin.konan.target.*
2
18
3
19
plugins {
@@ -17,10 +33,12 @@ kotlin {
17
33
jvm {
18
34
withJava()
19
35
}
20
- js(IR ) {
36
+ js(" browser " ) {
21
37
browser {
22
38
binaries.executable()
23
39
}
40
+ }
41
+ js(" nodejs" ) {
24
42
nodejs {
25
43
binaries.executable()
26
44
}
@@ -33,25 +51,37 @@ kotlin {
33
51
}?.binaries {
34
52
executable {
35
53
entryPoint = " io.rsocket.kotlin.samples.chat.client.main"
36
- freeCompilerArgs + = " -Xdisable-phases=EscapeAnalysis" // TODO
37
54
}
38
55
}
39
56
40
57
sourceSets {
41
58
commonMain {
42
59
dependencies {
43
60
implementation(project(" :api" ))
44
- implementation(" io.rsocket.kotlin:rsocket-transport-ktor-client:$rsocketVersion " )
61
+ implementation(" io.rsocket.kotlin:rsocket-transport-ktor-websocket- client:$rsocketVersion " )
45
62
}
46
63
}
47
64
val jvmMain by getting {
48
65
dependencies {
66
+ implementation(" io.rsocket.kotlin:rsocket-transport-ktor-tcp:$rsocketVersion " )
49
67
implementation(" io.ktor:ktor-client-cio:$ktorVersion " )
50
68
}
51
69
}
52
- val jsMain by getting {
70
+ findByName(" nativeMain" )?.apply {
71
+ dependencies {
72
+ implementation(" io.rsocket.kotlin:rsocket-transport-ktor-tcp:$rsocketVersion " )
73
+ implementation(" io.ktor:ktor-client-cio:$ktorVersion " )
74
+ }
75
+ }
76
+ val browserMain by getting {
77
+ dependencies {
78
+ implementation(" io.ktor:ktor-client-js:$ktorVersion " )
79
+ }
80
+ }
81
+ val nodejsMain by getting {
53
82
dependencies {
54
- implementation(" io.ktor:ktor-client-core:$ktorVersion " )
83
+ implementation(" io.ktor:ktor-client-js:$ktorVersion " )
84
+ implementation(" io.rsocket.kotlin:rsocket-transport-nodejs-tcp:$rsocketVersion " )
55
85
}
56
86
}
57
87
}
0 commit comments