-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
85 lines (71 loc) · 2.11 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
82
83
84
85
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("com.github.jengelman.gradle.plugins:shadow:6.1.0")
}
}
plugins {
application
id("com.github.johnrengelman.shadow") version "6.1.0"
kotlin("jvm") version "1.4.31"
kotlin("plugin.serialization") version "1.4.31"
}
group = "io.github.lordraydenmk"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
application {
val className = "io.ktor.server.netty.EngineMain"
mainClass.set(className)
// https://github.com/johnrengelman/shadow/issues/336
mainClassName = className
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions.jvmTarget = "11"
val cleanTask = tasks.named("clean")
tasks.named("build").configure {
mustRunAfter(cleanTask)
}
tasks.register("stage") {
dependsOn(tasks.named("build"), cleanTask)
}
sourceSets {
test {
java {
setSrcDirs(listOf("src/testFixtures/kotlin"))
}
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
dependencies {
implementation(kotlin("stdlib"))
val ktor_version = "1.5.3"
implementation("io.ktor:ktor-server-core:$ktor_version")
implementation("io.ktor:ktor-server-netty:$ktor_version")
implementation("ch.qos.logback:logback-classic:1.2.3")
implementation("io.ktor:ktor-serialization:$ktor_version")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.1.0")
val exposedVersion = "0.30.1"
implementation("org.jetbrains.exposed:exposed-core:$exposedVersion")
implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion")
implementation("org.postgresql:postgresql:42.2.19")
testImplementation("io.ktor:ktor-server-tests:$ktor_version")
val kotest_version = "4.4.3"
testImplementation("io.kotest:kotest-runner-junit5:$kotest_version")
testImplementation("io.kotest:kotest-assertions-ktor:$kotest_version")
}
tasks.withType<Jar> {
manifest {
attributes(
mapOf(
"Main-Class" to application.mainClass.get()
)
)
}
}