-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
147 lines (127 loc) · 3.83 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
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
val arkenvVersion: String by project
val exposedVersion: String by project
val flywayVersion: String by project
val hikariVersion: String by project
val jacocoVersion: String by project
val jbcryptVersion: String by project
val jUnitVersion: String by project
val koinVersion: String by project
val kotlinLoggingVersion: String by project
val kotlinResultVersion: String by project
val kotlinVersion: String by project
val ktorVersion: String by project
val logbackVersion: String by project
val postgresqlVersion: String by project
val prometheusVersion: String by project
plugins {
application
kotlin("jvm")
kotlin("plugin.serialization")
id("org.jetbrains.dokka")
id("org.jlleitschuh.gradle.ktlint")
id("com.github.johnrengelman.shadow")
jacoco
}
group = "eu.yeger"
version = "1.0.0"
application {
mainClass.set("io.ktor.server.netty.EngineMain")
}
kotlin {
explicitApi()
jvmToolchain(17)
}
sourceSets {
main {
java.srcDirs("src")
resources.srcDirs("resources")
}
test {
java.srcDirs("test")
resources.srcDirs("testresources")
}
}
repositories {
mavenLocal()
mavenCentral()
maven(url = uri("https://kotlin.bintray.com/ktor"))
}
dependencies {
// Kotlin
implementation(kotlin("test"))
// Ktor
implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("io.ktor:ktor-server-core:$ktorVersion")
implementation("io.ktor:ktor-server-host-common:$ktorVersion")
implementation("io.ktor:ktor-auth:$ktorVersion")
implementation("io.ktor:ktor-auth-jwt:$ktorVersion")
implementation("io.ktor:ktor-serialization:$ktorVersion")
implementation("io.ktor:ktor-metrics-micrometer:$ktorVersion")
// Database
implementation("org.jetbrains.exposed:exposed-core:$exposedVersion")
implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion")
// Logging & monitoring
implementation("ch.qos.logback:logback-classic:$logbackVersion")
implementation("io.github.microutils:kotlin-logging:$kotlinLoggingVersion")
implementation("io.micrometer:micrometer-registry-prometheus:$prometheusVersion")
// Other
implementation("com.apurebase:arkenv:$arkenvVersion")
implementation("io.insert-koin:koin-ktor:$koinVersion")
implementation("com.michael-bull.kotlin-result:kotlin-result:$kotlinResultVersion")
implementation("com.zaxxer:HikariCP:$hikariVersion")
implementation("org.postgresql:postgresql:$postgresqlVersion")
implementation("org.flywaydb:flyway-core:$flywayVersion")
implementation("org.mindrot:jbcrypt:$jbcryptVersion")
// Test
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$jUnitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$jUnitVersion")
testImplementation("io.ktor:ktor-server-tests:$ktorVersion")
}
tasks {
ktlintFormat {
// Delete the folders that are incorrectly generated by ktlintFormat
doLast {
delete("/src/main", "/src/test")
}
}
run.configure {
environment(
"DATABASE_HOST" to "localhost",
"DATABASE_PORT" to "5432",
"DATABASE_NAME" to "apollo-database",
"DATABASE_USER" to "apollo-database",
"DATABASE_PASSWORD" to "apollo-database",
"JWT_SECRET" to "apollo-admin-secret",
)
}
test {
useJUnitPlatform()
}
shadowJar {
archiveFileName.set("${project.name}.jar")
}
jacocoTestReport {
reports {
xml.required.set(true)
html.required.set(false)
}
}
withType<org.jetbrains.dokka.gradle.DokkaTask>().configureEach {
dokkaSourceSets {
named("main") {
displayName.set("Apollo-Backend")
reportUndocumented.set(true)
sourceLink {
localDirectory.set(file("src/"))
remoteUrl.set(uri("https://github.com/DerYeger/apollo-backend/tree/master/src").toURL())
}
}
}
}
withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
}
jacoco {
toolVersion = jacocoVersion
}