-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
100 lines (85 loc) · 2.99 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.base.DokkaBase
import org.jetbrains.dokka.base.DokkaBaseConfiguration
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.dokka.versioning.VersioningConfiguration
import org.jetbrains.dokka.versioning.VersioningPlugin
import java.util.Calendar
plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.publish.plugin)
alias(libs.plugins.detekt)
alias(libs.plugins.dokka)
}
buildscript {
dependencies {
classpath(libs.dokka.base)
classpath(libs.dokka.versioning)
}
}
dependencies {
dokkaPlugin(libs.dokka.versioning)
}
// makes :publishToSonatype callable at root
version = rootProject.property("VERSION")
?: throw GradleException("Project version property is missing")
group = rootProject.property("GROUP")
?: throw GradleException("Project group property is missing")
nexusPublishing {
// this = https://github.com/gradle-nexus/publish-plugin/issues/220
this.repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(
uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"),
)
username.set(System.getenv("SONATYPE_USER"))
password.set(System.getenv("SONATYPE_PASS"))
}
}
}
allprojects {
apply(plugin = "io.gitlab.arturbosch.detekt")
dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.7")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-rules-libraries:1.23.7")
}
detekt {
parallel = true
ignoreFailures = true
buildUponDefaultConfig = true
config.setFrom("${rootProject.projectDir}/detekt.yml")
}
}
subprojects {
// TODO: Move this into composite builds once dokka
// plugins are available to be used there,
tasks.withType<DokkaTask>().configureEach {
val docVersionsDir = rootProject.projectDir.resolve("docs/api/${project.name}")
val currentVersion = project.version.toString()
val currentDocsDir = docVersionsDir.resolve(currentVersion)
outputDirectory.set(currentDocsDir)
pluginConfiguration<VersioningPlugin, VersioningConfiguration> {
olderVersionsDir = docVersionsDir
version = currentVersion
}
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
footerMessage =
// get current year
"© ${Calendar.getInstance().get(Calendar.YEAR)}" +
" Kipher Author & Contributors | " +
"Licensed under" +
"<a href='https://github.com/jhdcruz/kipher/blob/main/LICENSE.txt'>" +
"The Apache 2.0 License" +
"</a>"
}
dokkaSourceSets {
configureEach {
includes.from(
files(
"README.md",
),
)
}
}
}
}