-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle.kts
125 lines (100 loc) · 3.62 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("com.github.johnrengelman.shadow")
id("com.squareup.sqldelight")
application
idea
}
group = "moe.nikky"
version = "0.1-SNAPSHOT"
application {
// mainClassName = "io.ktor.server.netty.DevelopmentEngine"
mainClassName = "moe.nikky.curseproxy.MainKt"
// seems to not apply to runShadowJar ?
applicationDefaultJvmArgs = listOf(
"-Dkotlinx.coroutines.debug=on"
)
}
sqldelight {
database("CurseDatabase"){
packageName = "moe.nikky.curseproxy.data"
sourceFolders = listOf("sqldelight")
schemaOutputDirectory = file("src/main/sqldelight/migrations")
}
}
val databaseSource = project.buildDir.resolve("sqldelight").resolve("CurseDatabase")
kotlin {
sourceSets {
getByName("main") {
kotlin.srcDir(databaseSource)
}
}
}
idea {
module {
generatedSourceDirs.add(databaseSource)
}
}
//war {
// webAppDirName = "webapp"
//}
//tomcat {
// contextPath = "/"
// httpProtocol = "org.apache.coyote.http11.Http11Nio2Protocol"
// ajpProtocol = "org.apache.coyote.ajp.AjpNio2Protocol"
//}
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation(kotlin("stdlib-jdk8", Kotlin.version))
implementation(kotlin("reflect", Kotlin.version))
// compile(kotlin("runtime", Kotlin.version))
implementation(Ktor.server.netty)
// implementation(Ktor.server.servlet)
implementation(Ktor.features.jackson)
implementation(Ktor.features.htmlBuilder)
// implementation("io.ktor:ktor-webjars:_")
// tomcat("org.apache.tomcat.embed:tomcat-embed-core:${Tomcat.version}",
// "org.apache.tomcat.embed:tomcat-embed-jasper:${Tomcat.version}")
// Logging
implementation(group = "io.github.microutils", name = "kotlin-logging", version = "_")
implementation(group = "ch.qos.logback", name = "logback-classic", version = "_")
// Networking
implementation(group = "com.github.kittinunf.fuel", name = "fuel", version = "_")
implementation(group = "com.github.kittinunf.fuel", name = "fuel-coroutines", version = "_")
implementation(group = "com.github.kittinunf.fuel", name = "fuel-kotlinx-serialization", version = "_")
// GraphQL
implementation(group = "com.apurebase", name = "kgraphql", version = "_")
// Dependency Injection
implementation(group = "org.koin", name = "koin-ktor", version = "_")
implementation("org.koin:koin-logger-slf4j:_")
// Database
implementation(group = "com.squareup.sqldelight", name = "sqlite-driver", version = "_")
// JSON
implementation(group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-runtime", version = Serialization.version)
implementation(group = "com.fasterxml.jackson.core", name = "jackson-databind", version = "_")
implementation(group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin", version = "_")
// coroutines
implementation(group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-debug", version = "_")
// graphiql
// does not help with hosting a static html+js blob
// implementation("org.webjars:graphiql:_")
// Testing
testImplementation(group = "junit", name = "junit", version = "_")
testImplementation(Ktor.server.testHost)
}
tasks.withType<KotlinCompile> {
kotlinOptions {
apiVersion = "1.3"
languageVersion = "1.3"
jvmTarget = "1.8"
}
}
tasks.withType<Wrapper> {
gradleVersion = Gradle.version
distributionType = Gradle.distributionType // Wrapper.DistributionType.ALL
}