-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
113 lines (95 loc) · 3.08 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
buildscript {
ext.kotlin_version = '1.3.61'
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.2.4.RELEASE"
}
}
plugins {
id("io.gitlab.arturbosch.detekt").version("1.3.1")
id 'jacoco'
}
repositories {
mavenCentral()
jcenter()
}
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'org.jetbrains.kotlin.plugin.spring'
bootJar {
baseName = 'kotlin-spring-gradle-starter'
}
group 'ru.akrikheli'
ext {
mockitoKotlinVersion = '2.1.0'
mockitoInlineVersion = '2.8.47'
mockwebserverVersion = '4.3.1'
jacksonKotlinVersion = '2.9.10'
}
detekt {
failFast = true // fail build on any finding
buildUponDefaultConfig = true // preconfigure defaults
config = files("$projectDir/config/detekt/detekt.yml")
reports {
html.enabled = true
xml.enabled = false
txt.enabled = false
}
}
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
dependsOn = allprojects.test
sourceDirectories = rootProject.files(allprojects.jacocoTestReport.sourceDirectories)
classDirectories = rootProject.files(allprojects.jacocoTestReport.classDirectories)
executionData = rootProject.files(allprojects.jacocoTestReport.executionData)
reports {
html.enabled = true
xml.enabled = false
csv.enabled = false
}
}
test {
useJUnitPlatform {
includeEngines 'junit-jupiter', 'junit-vintage'
}
}
check.dependsOn jacocoRootReport
// Api/Impl
dependencies {
// spring
implementation("org.springframework.boot:spring-boot-starter-actuator")
// kotlin
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:${jacksonKotlinVersion}")
}
// Tests
dependencies {
// spring
testImplementation("org.springframework.boot:spring-boot-starter-test")
// jupiter
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.junit.jupiter:junit-jupiter-params"
testRuntime "org.junit.jupiter:junit-jupiter-engine"
testRuntime "org.junit.vintage:junit-vintage-engine"
// kotlin
testRuntime "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit5:$kotlin_version"
// mockito
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:${mockitoKotlinVersion}")
testImplementation("org.mockito:mockito-inline:${mockitoInlineVersion}")
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}