-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
116 lines (99 loc) · 3.34 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
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.gradle.api.plugins.ExtensionAware
import org.junit.platform.gradle.plugin.FiltersExtension
import org.junit.platform.gradle.plugin.EnginesExtension
import org.junit.platform.gradle.plugin.JUnitPlatformExtension
buildscript {
repositories {
mavenCentral()
jcenter()
}
val kotlinVersion by extra { "1.2.50" }
val springBootVersion by extra { "2.0.3.RELEASE" }
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion")
classpath("org.junit.platform:junit-platform-gradle-plugin:1.0.0")
}
}
plugins {
kotlin("jvm").version("1.2.51")
application
java
id("io.gitlab.arturbosch.detekt").version("1.0.0.RC8")
}
apply {
plugin("kotlin")
plugin("kotlin-spring")
plugin("eclipse")
plugin("org.springframework.boot")
plugin("io.spring.dependency-management")
plugin("org.junit.platform.gradle.plugin")
}
application {
group = "ru.jmorozov"
version = "1.0"
applicationName = "prod-calendar"
mainClassName = "ru.jmorozov.prodkalendar.ProdKalendarApplicationKt"
}
configure<JavaPluginConvention> {
setSourceCompatibility(1.8)
setTargetCompatibility(1.8)
}
configure<JUnitPlatformExtension> {
filters {
engines {
include("spek")
}
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.freeCompilerArgs = listOf("-Xjsr305=strict")
kotlinOptions.jvmTarget = "1.8"
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
compile("com.fasterxml.jackson.module:jackson-module-kotlin")
compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
compile("org.jetbrains.kotlin:kotlin-reflect")
compile("org.jsoup:jsoup:1.11.3")
compile("org.apache.commons:commons-csv:1.4")
compile("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.+")
compile("org.springframework.boot:spring-boot-starter-cache")
compile("org.ehcache:ehcache")
compile("javax.cache:cache-api")
testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile("org.jetbrains.spek:spek-api:1.1.5")
testRuntime("org.jetbrains.spek:spek-junit-platform-engine:1.1.5")
testImplementation("org.amshove.kluent:kluent:1.40")
detekt("io.gitlab.arturbosch.detekt:detekt-formatting:1.0.0.RC8")
}
// extension for configuration
fun JUnitPlatformExtension.filters(setup: FiltersExtension.() -> Unit) {
when (this) {
is ExtensionAware -> extensions.getByType(FiltersExtension::class.java).setup()
else -> throw Exception("${this::class} must be an instance of ExtensionAware")
}
}
fun FiltersExtension.engines(setup: EnginesExtension.() -> Unit) {
when (this) {
is ExtensionAware -> extensions.getByType(EnginesExtension::class.java).setup()
else -> throw Exception("${this::class} must be an instance of ExtensionAware")
}
}
detekt {
version = "1.0.0.RC8"
profile("main", Action {
input = "src/main/kotlin"
config = file("detekt.yml")
filters = ".*/resources/.*,.*/tmp/.*"
output = "reports"
outputName = "detekt-report"
baseline = "reports/baseline.xml"
})
}