-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuild.gradle
122 lines (102 loc) · 3.26 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
buildscript {
ext {
kotlinGradlePluginVersion = "1.2.0"
junitPlatformGradlePluginVersion = "1.0.2"
dokkaGradlePluginVersion = "0.9.15"
detektGradlePluginVersion = "1.0.0.RC5-6"
}
repositories {
mavenCentral()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinGradlePluginVersion"
classpath "org.junit.platform:junit-platform-gradle-plugin:$junitPlatformGradlePluginVersion"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaGradlePluginVersion"
classpath "gradle.plugin.io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektGradlePluginVersion"
}
}
apply plugin: "kotlin"
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
apply plugin: "org.junit.platform.gradle.plugin"
junitPlatform {
filters {
engines {
include "junit-jupiter"
}
}
}
apply plugin: "org.jetbrains.dokka"
dokka {
outputFormat = "html"
outputDirectory = "$buildDir/dokka"
}
apply plugin: "io.gitlab.arturbosch.detekt"
detekt {
profile("main") {
config = "$projectDir/detekt.yml"
input = "$projectDir/src"
}
}
apply plugin: "application"
mainClassName = "org.vld.sdp.MainKt"
ext {
kotlinVersion = "1.2.0"
junitJupiterVersion = "5.0.2"
junitPlatformVersion = "1.0.2"
assertJVersion = "3.8.0"
mockitoVersion = "2.12.0"
ktLintVersion = "0.14.0"
}
repositories {
mavenCentral()
jcenter()
}
configurations {
ktlint
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
testCompile "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
testCompile "org.junit.jupiter:junit-jupiter-params:$junitJupiterVersion"
testCompile "org.junit.platform:junit-platform-runner:$junitPlatformVersion"
testCompile "org.assertj:assertj-core:$assertJVersion"
testCompile "org.mockito:mockito-core:$mockitoVersion"
testRuntime "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"
testRuntime "org.junit.platform:junit-platform-console-standalone:$junitPlatformVersion"
ktlint "com.github.shyiko:ktlint:$ktLintVersion"
}
// Usage: $ gradle junitPlatformTestConsole -PincludePackage=org.vld.sdp.behavioral
task junitPlatformTestConsole(type: JavaExec) {
description = "JUnit Platform Test Console"
jvmArgs "-ea"
classpath = project.sourceSets.test.runtimeClasspath
main = "org.junit.platform.console.ConsoleLauncher"
args "--include-engine=junit-jupiter", "--scan-class-path", "--reports-dir=$project.testReportDir"
if (project.hasProperty("includePackage")) {
args += "--include-package=$includePackage"
}
}
task ktLint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style"
classpath = configurations.ktlint
main = "com.github.shyiko.ktlint.Main"
args "--verbose", "src/**/*.kt"
}
check.dependsOn ktLint
task ktFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations"
classpath = configurations.ktlint
main = "com.github.shyiko.ktlint.Main"
args "-F", "src/**/*.kt"
}