-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
177 lines (137 loc) · 5.47 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
177 lines (137 loc) · 5.47 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
val kotlinVersion: String by project
val composeVersion: String by project
val logbackVersion: String by project
val ktorVersion: String by project
val skikoVersion: String by project
val coroutinesVersion: String by project
val skikoRuntimeVersion: String by project
val koinVersion: String by project
val exposedVersion: String by project
val postgresqlVersion: String by project
plugins {
kotlin("multiplatform") version "1.9.0"
id("org.jetbrains.compose") version "1.5.0-beta01"
id("org.jetbrains.kotlin.plugin.serialization") version "1.9.0"
application
}
group = "ru.tanexc"
version = "1.0"
repositories {
jcenter()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://maven.pkg.jetbrains.space/public/p/ktor/eap")
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
google()
}
kotlin {
jvm {
compilations.all {
kotlinOptions {
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
jvmTarget = "1.8"
}
}
withJava()
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
js(IR) {
binaries.executable()
browser {
commonWebpackConfig {
cssSupport {
enabled.set(true)
}
}
}
}
sourceSets {
val commonMain by getting {
dependencies {
// Coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
// Compose
implementation(compose.runtime)
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.components.resources)
implementation(compose.html.core)
implementation(compose.foundation)
implementation(compose.material3)
// Serialization
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
// Koin
implementation("io.insert-koin:koin-core:$koinVersion")
// Bcrypt
implementation("at.favre.lib:bcrypt:0.10.2")
// WindowSizeClass
implementation("dev.chrisbanes.material3:material3-window-size-class-multiplatform:0.3.0")
}
}
val jsMain by getting {
dependencies {
// Ktor
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-client-websockets:$ktorVersion")
// Skiko
implementation("org.jetbrains.skiko:skiko-js:$skikoVersion")
implementation("org.jetbrains.skiko:skiko-js-runtime:$skikoRuntimeVersion")
// Serialization
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
dependsOn(commonMain)
}
}
val jvmMain by getting {
dependencies {
// Ktor
implementation("io.ktor:ktor-server-core-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-html-builder-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-websockets-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-content-negotiation-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-sessions-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-netty-jvm:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-auth-jwt-jvm:$ktorVersion")
// Serialization
implementation("io.ktor:ktor-serialization-kotlinx-json-jvm:$ktorVersion")
// Exposed
implementation("org.jetbrains.exposed:exposed-core:$exposedVersion")
implementation("org.jetbrains.exposed:exposed-dao:$exposedVersion")
implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion")
// PostgreSQL
implementation("org.postgresql:postgresql:$postgresqlVersion")
// Html
implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:0.8.1")
// Logs
implementation("ch.qos.logback:logback-classic:$logbackVersion")
// Koin
implementation("io.insert-koin:koin-ktor:$koinVersion")
// SLF4J Logger
implementation("io.insert-koin:koin-logger-slf4j:$koinVersion")
dependsOn(commonMain)
}
}
}
}
application {
mainClass.set("ru.tanexc.application.ServerKt")
}
tasks.named<Copy>("jvmProcessResources") {
val jsBrowserDistribution = tasks.named("jsBrowserDistribution")
from(jsBrowserDistribution)
}
tasks.named<JavaExec>("run") {
dependsOn(tasks.named<Jar>("jvmJar"))
classpath(tasks.named<Jar>("jvmJar"))
classpath("androidx.compose.runtime:runtime:1.5.0-beta01")
}
compose.experimental {
web.application {}
}
compose {
kotlinCompilerPlugin.set(composeVersion)
kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=$kotlinVersion")
}