-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
110 lines (94 loc) · 3.42 KB
/
build.gradle
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
plugins {
id 'java'
id 'application'
id 'jacoco'
id 'com.github.johnrengelman.shadow' version '4.0.1'
id 'org.jetbrains.kotlin.jvm' version '1.3.41'
}
repositories {
mavenLocal()
jcenter()
maven { url "https://dl.bintray.com/kotlin/ktor" }
maven { url 'https://jitpack.io' }
maven { url "https://dl.bintray.com/spekframework/spek-dev" }
}
group 'jdbcat.examples'
version '1.0-SNAPSHOT'
// Application entry point. This will run ktor and ktor will run our application
// based on /resources/application.conf settings
mainClassName = "io.ktor.server.netty.DevelopmentEngine"
configurations {
ktlint
}
sourceCompatibility = 1.8
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation group: "com.github.mobiletoly", name: "jdbcat-core", version: "master-SNAPSHOT", changing: true
implementation "io.ktor:ktor-server-netty:$ktor_version"
implementation "io.ktor:ktor-jackson:$ktor_version"
implementation "org.koin:koin-ktor:$koin_version"
implementation "org.koin:koin-logger-slf4j:$koin_version"
implementation 'org.koin:koin-ktor:$koin_version'
implementation "com.zaxxer:HikariCP:$hikaricp_version"
implementation "io.github.microutils:kotlin-logging:$mu_logging_version"
implementation "ch.qos.logback:logback-classic:$logback_version"
implementation "org.postgresql:postgresql:$postgres_driver_version"
testCompile("io.ktor:ktor-server-test-host:$ktor_version")
testCompile("org.testcontainers:postgresql:$testcontainers_version")
testCompile("org.amshove.kluent:kluent:$kluent_version")
testCompile('org.junit.jupiter:junit-jupiter-api:5.2.0')
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.2.0')
testImplementation ("org.spekframework.spek2:spek-dsl-jvm:$spek_version") {
exclude group: 'org.jetbrains.kotlin'
}
testRuntimeOnly ("org.spekframework.spek2:spek-runner-junit5:$spek_version") {
exclude group: 'org.junit.platform'
exclude group: 'org.jetbrains.kotlin'
}
ktlint "com.github.shyiko:ktlint:0.29.0"
}
// --- Run "./gradle shadowJar" to generate fat jar with all dependencies
shadowJar {
baseName = 'jdbcat-ktor-backend'
classifier = null
version = null
}
// --- ktlint configuration --
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style"
classpath = configurations.ktlint
main = "com.github.shyiko.ktlint.Main"
args = ["src/**/*.kt"]
// to generate report in checkstyle format prepend following args:
// "--reporter=plain", "--reporter=checkstyle,output=${buildDir}/ktlint.xml"
// see https://github.com/shyiko/ktlint#usage for more
}
task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
classpath = configurations.ktlint
main = "com.github.shyiko.ktlint.Main"
args = ["-F", "src/**/*.kt"]
}
check.dependsOn ktlint
test {
useJUnitPlatform {
includeEngines 'spek2'
}
dependsOn 'cleanTest'
// Show test results.
testLogging {
events "passed", "skipped", "failed"
}
}
jacoco {
toolVersion = "0.8.2"
reportsDir = file("$buildDir/jacoco") // Jacoco's output root.
}
test.finalizedBy(jacocoTestReport)