-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle
More file actions
131 lines (107 loc) · 3.25 KB
/
Copy pathbuild.gradle
File metadata and controls
131 lines (107 loc) · 3.25 KB
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
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.61'
id 'com.github.ben-manes.versions' version '0.28.0'
id 'io.gitlab.arturbosch.detekt' version '1.6.0'
}
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'jacoco'
defaultTasks 'run'
mainClassName = 'com.michalkowol.BootKt'
jar {
manifest {
attributes 'Main-Class': mainClassName
}
}
compileKotlin {
kotlinOptions.jvmTarget = '1.8'
}
task fatJar(type: Jar) {
baseName = "${project.name}-assembly"
manifest = jar.manifest
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
sourceSets {
integrationTest {
kotlin {
srcDirs += 'src/it/kotlin'
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
}
resources.srcDirs += 'src/it/resources'
}
}
task integrationTest(group: 'verification', type: Test, description: 'Runs integration tests.') {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
}
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}
task stage(dependsOn: ['fatJar', 'build', 'clean'])
build.mustRunAfter clean
fatJar.mustRunAfter build
stage.dependsOn(fatJar)
jacoco {
toolVersion = '0.8.5'
}
jacocoTestReport {
reports {
csv.enabled false
html.enabled true
xml.enabled true
}
dependsOn test
}
test {
useJUnitPlatform()
}
detekt {
config = files('detekt.yml')
failFast = true
input = files(
'src/main/kotlin',
'src/test/kotlin',
'src/it/kotlin'
)
}
check {
dependsOn = check.dependsOn + [integrationTest]
}
repositories {
mavenCentral()
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'http://dl.bintray.com/kotlin/kotlinx.coroutines' }
maven { url 'https://jitpack.io' }
}
dependencies {
ext.rinca = '0.12.0'
compile 'org.slf4j:slf4j-api:1.7.25'
compile 'ch.qos.logback:logback-classic:1.2.3'
compile 'com.sparkjava:spark-core:2.9.1'
compile 'org.kodein.di:kodein-di-generic-jvm:6.5.2'
compile 'com.typesafe:config:1.4.0'
compile 'com.github.kittinunf.result:result:3.0.0'
compile 'com.zaxxer:HikariCP:3.4.2'
compile 'org.flywaydb:flyway-core:6.2.4'
compile 'com.h2database:h2:1.4.200'
compile 'org.postgresql:postgresql:42.2.10'
compile "com.github.softwareberg.rinca:database:$rinca"
compile "com.github.softwareberg.rinca:httpclient:$rinca"
compile "com.github.softwareberg.rinca:json:$rinca"
compile "com.github.softwareberg.rinca:xml:$rinca"
compile "javax.xml.bind:jaxb-api:2.3.1"
compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3"
compile "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.3.3"
testCompile 'org.junit.jupiter:junit-jupiter-engine:5.6.0'
testCompile 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0'
testCompile 'org.assertj:assertj-core:3.15.0'
integrationTestCompile 'com.ninja-squad:DbSetup-kotlin:2.1.0'
integrationTestCompile 'com.despegar:spark-test:1.1.8'
}
wrapper {
gradleVersion = '6.2.1'
}