forked from arrow-kt/arrow-meta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
100 lines (88 loc) · 2.85 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
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.dokka) apply false
alias(libs.plugins.arrowGradleConfig.nexus)
alias(libs.plugins.arrowGradleConfig.formatter)
alias(libs.plugins.arrowGradleConfig.versioning)
java
}
allprojects {
repositories {
mavenCentral()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/")
}
group = property("projects.group").toString()
}
tasks {
create<Exec>("generateDoc") {
commandLine("sh", "gradlew", "dokkaJekyll")
}
create("buildMetaDoc") {
group = "documentation"
description = "Generates API Doc and validates all the documentation"
dependsOn("generateDoc")
}
}
// declare Dokka implicit dependencies
val libNames = listOf("arrow-meta", "arrow-meta-test", "arrow-gradle-plugin-commons")
task("docsJar") {
libNames.forEach {
dependsOn(tasks.getByPath(":${it}:dokkaHtml"))
}
}
libNames.forEach { task ->
libNames.forEach {
tasks.getByPath(":${task}:docsJar").dependsOn(":${it}:dokkaHtml")
}
}
allprojects {
this.tasks.withType<Test>() {
useJUnitPlatform()
testLogging {
showStandardStreams = true
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
events("passed", "skipped", "failed", "standardOut", "standardError")
}
systemProperty(
"arrow.meta.generate.source.dir",
File("$buildDir/generated/meta/tests").absolutePath
)
systemProperty("CURRENT_VERSION", "$version")
systemProperty("arrowVersion", libs.versions.arrow.get())
systemProperty("jvmTargetVersion", properties["jvmTargetVersion"].toString())
jvmArgs = listOf("""-Dkotlin.compiler.execution.strategy="in-process"""")
}
}
allprojects {
extra.set("dokka.outputDirectory", rootDir.resolve("docs/docs/apidocs"))
}
configure(subprojects - project(":arrow-meta-docs")) {
apply(plugin = "org.jetbrains.dokka")
tasks.named<DokkaTask>("dokkaJekyll") {
outputDirectory.set(file("$rootDir/docs/docs/apidocs"))
dokkaSourceSets {
val arrowMetaBlobMain = "https://github.com/arrow-kt/arrow-meta/blob/main"
configureEach {
skipDeprecated.set(true)
reportUndocumented.set(true)
sourceRoots.filter { it.path.contains(file("test/").path, ignoreCase = true) }
.forEach {
val file = it.relativeTo(projectDir)
println("HELLO: $file")
println("HELLO2: ${uri("$arrowMetaBlobMain/$file").toURL()}")
sourceLink {
localDirectory.set(file)
remoteUrl.set(
uri("$arrowMetaBlobMain/$file").toURL()
)
remoteLineSuffix.set("#L")
}
}
}
}
}
}