-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle.kts
59 lines (46 loc) · 1.4 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
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.kotlin
import org.gradle.kotlin.dsl.version
import org.jetbrains.kotlin.gradle.dsl.Coroutines
val kotlinVersion = "1.3.10"
val ktorVersion = "1.0.0"
plugins {
kotlin("jvm") version "1.3.10"
application
}
repositories {
jcenter()
mavenCentral()
"http://dl.bintray.com/kotlin".let {
maven { setUrl("$it/ktor") }
maven { setUrl("$it/kotlinx") }
}
}
dependencies {
fun ktor(s: String = "", v: String = ktorVersion) = "io.ktor:ktor$s:$v"
compile(kotlin("stdlib-jdk8", kotlinVersion))
compile("org.jetbrains.kotlinx:kotlinx-html-jvm:0.6.10")
compile(ktor())
compile(ktor("-gson"))
compile(ktor("-html-builder"))
compile(ktor("-server-netty"))
compile("ch.qos.logback:logback-classic:1.2.1")
compile("org.slf4j:slf4j-api:1.7.25")
testCompile(ktor("-server-test-host"))
testCompile("junit:junit:4.12")
}
application {
applicationName = "ktorapp"
group = "de.swirtz.kotlin.webdev"
mainClassName = "de.swirtz.kotlin.webdev.ktor.KtorServerKt"
}
tasks {
withType<Jar> {
manifest {
attributes(mapOf("Main-Class" to application.mainClassName))
}
val version = "1.0-SNAPSHOT"
archiveName = "${application.applicationName}-$version.jar"
from(configurations.compile.map { if (it.isDirectory) it else zipTree(it) })
}
}