-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
104 lines (89 loc) · 2.59 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm")
kotlin("plugin.spring")
id("org.jetbrains.dokka")
id("org.springframework.boot")
id("io.spring.dependency-management")
}
repositories {
mavenCentral()
}
dependencies {
// Kotlin
implementation("org.jetbrains.kotlin:kotlin-reflect")
// SpringBoot
implementation("org.springframework.boot:spring-boot-starter-web")
// Test
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude(group = "org.mockito")
}
testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc")
testImplementation("org.junit.jupiter:junit-jupiter-api")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}
tasks.dokkaHtml {
outputDirectory.set(layout.buildDirectory.dir("dokka").get().asFile)
}
tasks.dokkaHtml.configure {
dokkaSourceSets {
named("main") {
perPackageOption {
matchingRegex.set(".*kotlin/enums/.*")
suppress.set(true)
}
}
}
}
tasks.withType<Javadoc> {
(options as StandardJavadocDocletOptions).apply {
encoding = "UTF-8"
addStringOption("Xdoclint:none", "-quiet")
addStringOption("html5", "-quiet")
}
// https://github.com/gradle/gradle/issues/19726
val directories = sourceSets
.main
.get()
.java
.sourceDirectories
.joinToString(":")
(options as CoreJavadocOptions).addStringOption("-source-path", directories)
exclude("**/response/**", "**/request/**")
}
tasks.dokkaHtml.configure {
outputDirectory.set(layout.buildDirectory.dir("docs/dokka").get().asFile)
dokkaSourceSets {
named("main") {
perPackageOption {
matchingRegex.set(".*request.*")
suppress.set(true)
}
perPackageOption {
matchingRegex.set(".*response.*")
suppress.set(true)
}
}
}
}
configurations.matching { it.name.startsWith("dokka") }.configureEach {
resolutionStrategy.eachDependency {
if (requested.group.startsWith("com.fasterxml.jackson")) {
useVersion("2.15.3")
}
}
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}