-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
81 lines (67 loc) · 2.88 KB
/
build.gradle.kts
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
val ktor_version: String by project
val kotlin_version: String by project
val logback_version: String by project
val postgres_version: String by project
val hikari_version: String by project
val flyway_version: String by project
val exposed_version: String by project
val joda_time: String by project
plugins {
kotlin("jvm") version "2.1.10"
kotlin("plugin.serialization") version "2.1.10"
id("io.ktor.plugin") version "3.1.0"
id("com.avast.gradle.docker-compose") version "0.17.12"
}
group = "com"
version = "0.0.1"
application {
mainClass.set("io.ktor.server.netty.EngineMain")
val isDevelopment: Boolean = project.ext.has("development")
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=$isDevelopment")
}
repositories {
mavenCentral()
}
tasks.register<Delete>("cleanLog") {
delete(file("logs/application.log"))
}
tasks.named("run") {
dependsOn("cleanLog")
}
dependencies {
// Ktor
implementation("io.ktor:ktor-server-core-jvm:$ktor_version")
implementation("io.ktor:ktor-server-auth-jvm:$ktor_version")
implementation("io.ktor:ktor-server-auth-jwt-jvm:$ktor_version")
implementation("io.ktor:ktor-server-sessions-jvm:$ktor_version")
implementation("io.ktor:ktor-server-cors-jvm:$ktor_version")
implementation("io.ktor:ktor-server-call-logging-jvm:$ktor_version")
implementation("io.ktor:ktor-server-content-negotiation-jvm:$ktor_version")
implementation("io.ktor:ktor-serialization-jackson-jvm:$ktor_version")
implementation("io.ktor:ktor-server-http-redirect-jvm:$ktor_version")
implementation("io.ktor:ktor-server-netty-jvm:$ktor_version")
implementation("io.ktor:ktor-server-host-common-jvm:$ktor_version")
implementation("io.ktor:ktor-server-status-pages-jvm:$ktor_version")
// Serialization - not sure that they are required
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")
implementation("io.ktor:ktor-server-content-negotiation:$ktor_version")
// Logs
implementation("ch.qos.logback:logback-classic:$logback_version")
// Database
implementation("org.postgresql:postgresql:$postgres_version")
implementation("com.zaxxer:HikariCP:$hikari_version")
implementation("org.flywaydb:flyway-core:$flyway_version")
implementation("org.flywaydb:flyway-database-postgresql:$flyway_version")
implementation("org.jetbrains.exposed:exposed-core:$exposed_version")
implementation("org.jetbrains.exposed:exposed-json:$exposed_version")
runtimeOnly("org.jetbrains.exposed:exposed-jdbc:$exposed_version")
// Utils
implementation("joda-time:joda-time:$joda_time")
// Tests
testImplementation("io.ktor:ktor-server-tests-jvm:3.0.0-beta-1")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version")
}
dockerCompose {
useComposeFiles.set(listOf("${rootProject.projectDir}/docker-compose.yaml"))
isRequiredBy(tasks.named("run"))
}