-
Notifications
You must be signed in to change notification settings - Fork 449
/
build.gradle.kts
150 lines (131 loc) · 4.09 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
@file:Suppress("DSL_SCOPE_VIOLATION")
import kotlinx.knit.KnitPluginExtension
import kotlinx.validation.ExperimentalBCVApi
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
allprojects {
if (property("version") == "unspecified") {
setProperty("version", "2.0.0-SNAPSHOT")
}
}
buildscript {
repositories {
mavenCentral()
google()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
dependencies {
classpath(libs.kotlinx.knit)
}
}
allprojects {
repositories {
mavenCentral()
(project.rootProject.properties["kotlin_repo_url"] as? String)?.also { maven(it) }
google()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
}
plugins {
base
alias(libs.plugins.android.library) apply false
alias(libs.plugins.dokka)
alias(libs.plugins.animalSniffer) apply false
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlinx.serialization) apply false
alias(libs.plugins.kotlin.binaryCompatibilityValidator)
alias(libs.plugins.spotless) apply false
alias(libs.plugins.publish) apply false
alias(libs.plugins.compose.jetbrains) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.kotlinx.knit)
}
configure<KnitPluginExtension> {
siteRoot = "https://arrow-kt.io/"
rootDir = file("arrow-libs")
files = fileTree(file("arrow-libs")) {
include("**/*.md")
include("**/*.kt")
include("**/*.kts")
exclude("**/build/**")
exclude("**/.gradle/**")
}
}
dependencies {
kover(projects.arrowAtomic)
kover(projects.arrowAutoclose)
kover(projects.arrowCore)
kover(projects.arrowCoreHighArity)
kover(projects.arrowCoreRetrofit)
kover(projects.arrowCoreSerialization)
kover(projects.arrowCache4k)
kover(projects.arrowFunctions)
kover(projects.arrowFxCoroutines)
kover(projects.arrowFxStm)
kover(projects.arrowOptics)
kover(projects.arrowOpticsKspPlugin)
kover(projects.arrowOpticsReflect)
kover(projects.arrowOpticsCompose)
kover(projects.arrowResilience)
kover(projects.arrowCollectors)
kover(projects.arrowEval)
}
allprojects {
group = property("projects.group").toString()
}
private val kotlinXUpstream =
setOf(
"arrow-fx-coroutines",
"arrow-resilience",
"arrow-fx-stm",
"arrow-collectors"
)
subprojects {
tasks.withType<DokkaTaskPartial>().configureEach {
extensions.findByType<KotlinProjectExtension>()?.sourceSets?.forEach { kotlinSourceSet ->
dokkaSourceSets.named(kotlinSourceSet.name) {
perPackageOption {
matchingRegex.set(".*\\.internal.*")
suppress.set(true)
}
if (project.name in kotlinXUpstream) externalDocumentationLink("https://kotlinlang.org/api/kotlinx.coroutines/")
skipDeprecated.set(true)
reportUndocumented.set(false)
kotlinSourceSet.kotlin.srcDirs.filter { it.exists() }.forEach { srcDir ->
sourceLink {
localDirectory.set(srcDir)
remoteUrl.set(uri("https://github.com/arrow-kt/arrow/blob/main/${srcDir.relativeTo(rootProject.rootDir)}").toURL())
remoteLineSuffix.set("#L")
}
}
}
}
}
}
tasks {
val undocumentedProjects =
listOf(project(":arrow-optics-ksp-plugin"))
val copyCNameFile = register<Copy>("copyCNameFile") {
from(layout.projectDirectory.dir("static").file("CNAME"))
into(layout.projectDirectory.dir("docs"))
}
dokkaHtmlMultiModule {
dependsOn(copyCNameFile)
removeChildTasks(undocumentedProjects)
}
getByName("knitPrepare").dependsOn(getTasksByName("dokka", true))
withType<DokkaMultiModuleTask>().configureEach {
outputDirectory.set(file("docs"))
moduleName.set("Arrow")
}
}
apiValidation {
ignoredProjects.add("arrow-optics-ksp-plugin")
@OptIn(ExperimentalBCVApi::class)
klib.enabled = true
}