-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
113 lines (92 loc) · 2.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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.ktlint)
alias(libs.plugins.axion.release)
java
jacoco
`maven-publish`
`jacoco-report-aggregation`
}
repositories {
google()
mavenCentral()
}
scmVersion {
versionCreator("simple")
tag {
prefix.set("")
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
val scmVer = scmVersion.version!!
fun Project.isPluginProject() = this.name.contains("plugin")
fun Project.isExampleProject() = this.name.contains("example")
allprojects {
group = "com.keecon"
version = scmVer
repositories {
google()
mavenCentral()
}
if (!isExampleProject()) {
apply(plugin = "maven-publish")
apply(plugin = "org.jlleitschuh.gradle.ktlint")
}
apply(plugin = "java")
apply(plugin = "kotlin")
apply(plugin = "jacoco")
tasks.test {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport)
testLogging {
events("passed", "skipped", "failed")
}
}
}
subprojects {
tasks.named("compileKotlin", KotlinCompilationTask::class.java) {
compilerOptions {
freeCompilerArgs.add("-Xjsr305=strict")
}
}
if (!isPluginProject() && !isExampleProject()) {
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
create<MavenPublication>(project.name) {
from(components["java"])
}
}
}
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required.set(true)
html.required.set(true)
}
}
}
dependencies {
jacocoAggregation(project(":restdocs-api-spec"))
jacocoAggregation(project(":restdocs-api-spec-generator"))
jacocoAggregation(project(":restdocs-api-spec-gradle-plugin"))
jacocoAggregation(project(":restdocs-api-spec-jsonschema"))
jacocoAggregation(project(":restdocs-api-spec-mockmvc"))
jacocoAggregation(project(":restdocs-api-spec-model"))
}
tasks.testCodeCoverageReport {
reports {
xml.required.set(true)
html.required.set(true)
}
}