-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
94 lines (84 loc) · 2.28 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
import org.gradle.configurationcache.extensions.capitalized
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* To learn more about Gradle by exploring our Samples at https://docs.gradle.org/8.6/samples
*/
plugins {
alias(libs.plugins.dokka)
alias(libs.plugins.kotlin)
alias(libs.plugins.kover)
alias(libs.plugins.gitSemVer)
alias(libs.plugins.spotless)
}
gitSemVer {
// Your configuration
assignGitSemanticVersion()
}
val notKotlinProjects = listOf(
"frontend-service",
"notifications-service",
)
dependencies {
project.subprojects
.filter { it.name !in notKotlinProjects }
.forEach { kover(it) }
}
allprojects {
group = "piperkt"
}
subprojects {
if (name !in notKotlinProjects) {
apply(plugin = "org.jetbrains.dokka")
}
}
spotless {
yaml {
target("**/*.yml", "**/*.yaml")
targetExclude(
"**/build/**",
"**/node_modules/**",
"**/helm-chart/**",
"auth.yml",
"resources/report/**",
)
prettier()
}
}
val openApiProjects = listOf(
"friendships-service",
"multimedia-service",
"servers-service",
"users-service",
)
tasks.register<Copy>("buildOpenApiSite") {
dependsOn("build")
copy {
from("resources/openapi-site/index.html")
into(layout.buildDirectory.dir("openapi-site"))
// magic code for nice frontend :D
expand("serviceList" to """
${openApiProjects.joinToString("") {
"<li>" +
"<a href='./$it'>${it.split("-")
.joinToString(" ", transform = String::capitalized)}</a>" +
"</li>"
}}
""".trimIndent())
}
openApiProjects.forEach {
copy {
from("$it/build/generated/ksp/main/resources/META-INF/swagger/")
include("*.yml")
into(layout.buildDirectory.dir("openapi-site/$it"))
rename { _ -> "$it.yml" }
}
copy {
from("resources/openapi-site/openapi-static.html")
into(layout.buildDirectory.dir("openapi-site/$it"))
rename("openapi-static.html", "index.html")
expand("url" to "./$it.yml")
}
}
}