-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle.kts
124 lines (107 loc) · 3.17 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
117
118
119
120
121
122
123
124
/*
Copyright (c) 2018 Codice Foundation
Released under the GNU Lesser General Public License; see
http://www.gnu.org/licenses/lgpl.html
*/
// Build file
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
description = "SAML Conformance Test Kit"
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath(Libs.kotlinGradlePlugin)
classpath(Libs.gradleDockerPlugin)
}
}
plugins {
id("org.jetbrains.kotlin.jvm").version(Versions.kotlin)
id("io.gitlab.arturbosch.detekt").version(Versions.detekt)
id("com.diffplug.gradle.spotless").version(Versions.spotless)
id("net.ltgt.errorprone").version(Versions.errorprone)
id("com.adarshr.test-logger").version(Versions.testLogger)
}
allprojects {
group = "org.codice.samlconf"
version = Versions.project
repositories {
mavenLocal()
mavenCentral()
maven { url = uri("http://artifacts.codice.org/content/repositories/thirdparty/") }
jcenter()
}
apply(plugin = "com.diffplug.gradle.spotless")
spotless {
val kotlinLicenseFile = "codice.license.kt"
java {
licenseHeaderFile(rootProject.file(kotlinLicenseFile))
trimTrailingWhitespace()
googleJavaFormat()
}
kotlin {
ktlint()
licenseHeaderFile(rootProject.file(kotlinLicenseFile),
"(package|@file|// Default package)")
trimTrailingWhitespace()
endWithNewline()
}
kotlinGradle {
ktlint()
licenseHeaderFile(rootProject.file(kotlinLicenseFile), "// Build file")
trimTrailingWhitespace()
endWithNewline()
}
}
}
subprojects {
apply(plugin = "java")
apply(plugin = "maven")
apply(plugin = "kotlin")
apply(plugin = "kotlin-kapt")
apply(plugin = "com.bmuschko.docker-remote-api")
apply(plugin = "net.ltgt.errorprone")
apply(plugin = "com.adarshr.test-logger")
val sourceCompatibility = Versions.javaTarget
val targetCompatibility = Versions.javaTarget
dependencies {
compile("org.jetbrains.kotlin:kotlin-reflect")
compile(Libs.kotlinStdlibJdk8)
compile(Libs.kotlinTest)
compile(Libs.restAssured)
compile(Libs.slf4j)
compile(Libs.staticLog)
compile(Libs.guava)
compile(Libs.kotlinTestRunner)
compile(Libs.junitPlatformSuite)
compile(Libs.junitPlatformRunner)
testCompile(Libs.mockk)
errorprone(Libs.googleErrorProne)
}
tasks.withType<Test> {
useJUnitPlatform()
}
}
tasks {
"check" {
dependsOn("detektCheck")
}
}
detekt {
version = Versions.detekt
defaultProfile(Action {
input = rootProject.projectDir.absolutePath
config = "$projectDir/detekt.yml"
filters = ".*/resources/.*,.*/tmp/.*"
})
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = Versions.javaTarget
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = Versions.javaTarget
}
val compileJava: JavaCompile by tasks
compileJava.options.encoding = "UTF-8"