This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle.kts
107 lines (89 loc) · 2.83 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
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
import io.gitlab.arturbosch.detekt.report.ReportMergeTask
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.DokkaBaseConfiguration
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val sdkVersion: String by project
plugins {
kotlin("jvm") version "1.8.22"
id("org.jetbrains.dokka") version "1.8.20"
id("io.gitlab.arturbosch.detekt").version("1.23.1")
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
}
buildscript {
dependencies {
classpath("org.jetbrains.dokka:dokka-base:1.8.20")
}
}
repositories {
mavenCentral()
}
dependencies {
testImplementation(kotlin("test"))
}
tasks.named<Test>("test") {
useJUnitPlatform()
// failFast = true
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}
// Dokka configuration
subprojects {
// exclude the "playground" module from the dokka task
if (name != "playground") {
apply(plugin = "org.jetbrains.dokka")
// TODO: does not work ATM, if you can fix it, please do :)
tasks.withType<DokkaTask>().configureEach {
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
footerMessage = "(c) 2022-2023 Kryptokrona Developers"
}
}
}
}
tasks.dokkaHtmlMultiModule {
moduleName.set("Kryptokrona Kotlin SDK")
}
tasks.register<Copy>("copyDokkaHtmlMultiModule") {
dependsOn("dokkaHtmlMultiModule")
println("${projectDir}/docs/${sdkVersion}")
mkdir("${projectDir}/docs/${sdkVersion}")
from("${buildDir}/dokka/htmlMultiModule")
into(layout.buildDirectory.dir("${projectDir}/docs/${sdkVersion}"))
include("**/*.*")
}
val detektReportMergeSarif by tasks.registering(ReportMergeTask::class) {
output.set(layout.buildDirectory.file("reports/detekt/merge.sarif"))
}
allprojects {
apply(plugin = "io.gitlab.arturbosch.detekt")
detekt {
buildUponDefaultConfig = true
config.setFrom(file("${rootDir}/config/detekt.yml"))
}
tasks.withType<Detekt>().configureEach {
jvmTarget = "17"
reports {
xml.required.set(true)
html.required.set(true)
txt.required.set(true)
sarif.required.set(true)
md.required.set(true)
}
basePath = rootDir.absolutePath
finalizedBy(detektReportMergeSarif)
}
detektReportMergeSarif {
input.from(tasks.withType<Detekt>().map { it.sarifReportFile })
}
tasks.withType<DetektCreateBaselineTask>().configureEach {
jvmTarget = "17"
}
}
tasks.register<Exec>("startKryptokronaServices") {
commandLine("docker-compose", "up", "-d")
group = "kryptokrona"
description = "Start Kryptokrona services"
}