This repository has been archived by the owner on May 25, 2020. It is now read-only.
forked from gothinkster/realworld-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathbuild.gradle
149 lines (125 loc) · 3.86 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
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
148
149
group 'me.avo'
version '1.0'
buildscript {
ext {
kotlin_version = '1.2.51'
ktor_version = '0.9.3'
junit_version = '5.2.0'
}
repositories {
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.github.ben-manes:gradle-versions-plugin:0.20.0"
}
}
apply plugin: 'kotlin'
apply plugin: 'jacoco'
apply plugin: "com.github.ben-manes.versions"
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
kotlin {
experimental {
coroutines "enable"
}
}
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'conduit',
'Implementation-Version': version,
'Main-Class': 'me.avo.realworld.kotlin.ktor'
}
baseName = project.name
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
with jar
}
repositories {
mavenCentral()
jcenter()
maven { url "http://dl.bintray.com/kotlin/ktor" }
maven { url "http://dl.bintray.com/kotlin/exposed" }
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile group: "io.ktor", name: "ktor-server-core", version: ktor_version
compile group: "io.ktor", name: "ktor-server-cio", version: ktor_version
compile "io.ktor:ktor-auth-jwt:$ktor_version"
compile "io.ktor:ktor-jackson:$ktor_version"
compile group: "org.mindrot", name: "jbcrypt", version: "0.4"
compile 'com.github.salomonbrys.kotson:kotson:2.5.0'
compile group: "org.slf4j", name: "slf4j-simple", version: "1.7.25"
compile 'org.jetbrains.exposed:exposed:0.10.4'
compile group: 'com.h2database', name: 'h2', version: '1.4.197'
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junit_version
testCompile group: 'org.amshove.kluent', name: 'kluent', version: '1.39'
testCompile "io.ktor:ktor-server-test-host:$ktor_version"
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
testRuntime "org.junit.jupiter:junit-jupiter-engine:$junit_version"
}
test {
useJUnitPlatform {
excludeTags 'slow'
includeEngines 'junit-jupiter'
}
testLogging {
showStandardStreams = true
exceptionFormat "full"
events "failed"
}
//systemProperty 'junit.jupiter.execution.parallel.enabled', 'true'
failFast = false
}
check.dependsOn jacocoTestReport
check.dependsOn jacocoTestCoverageVerification
tasks.test.finalizedBy jacocoTestReport
jacoco {
toolVersion = "0.8.1"
reportsDir = file("$buildDir/reports")
}
jacocoTestReport {
group = "Reporting"
description = "Generate Jacoco coverage reports for Debug build"
reports {
xml.enabled = true
html.enabled = true
}
// what to exclude from coverage report
// UI, "noise", generated classes, platform classes, etc.
def excludes = [
'**/R.class',
'**/R$*.class',
'**/Manifest*.*',
'**/*Test*.*'
]
// generated classes
afterEvaluate {
classDirectories = project.files(classDirectories.files.collect {
fileTree(dir: it, excludes: excludes)
})
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.5
}
}
rule {
enabled = false
element = 'CLASS'
includes = ['org.gradle.*']
limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 0.3
}
}
}
}