This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
71 lines (60 loc) · 1.72 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
plugins {
idea
// id("simbot.changelog-generator")
// id("simbot.nexus-publish")
id("simbot.dokka-multi-module")
id("com.github.gmazzo.buildconfig") version "4.1.2" apply false
id("io.gitlab.arturbosch.detekt")
}
group = "love.forte.simbot"
version = "4.0-SNAPSHOT"
// kotlin {
// jvmToolchain(8)
// }
// https://github.com/detekt/detekt/blob/main/build.gradle.kts
allprojects {
repositories {
mavenCentral()
love.forte.gradle.common.core.repository.Repositories.Snapshot.Default.apply {
configMaven {
mavenContent {
snapshotsOnly()
}
}
}
mavenLocal()
}
// apply(plugin = "io.gitlab.arturbosch.detekt")
}
subprojects {
afterEvaluate {
if (plugins.hasPlugin("io.gitlab.arturbosch.detekt")) {
return@afterEvaluate
}
fun Project.hasKtP(): Boolean {
return plugins.findPlugin("org.jetbrains.kotlin.jvm") != null ||
plugins.findPlugin("org.jetbrains.kotlin.multiplatform") != null
}
if (hasKtP()) {
// apply(plugin = "io.gitlab.arturbosch.detekt")
applyDetekt()
}
}
}
fun Project.applyDetekt() {
apply(plugin = "io.gitlab.arturbosch.detekt")
detekt {
// buildUponDefaultConfig = true
config.from(rootProject.projectDir.resolve(".detekt/config/detekt.yml"))
baseline = rootProject.projectDir.resolve(".detekt/baseline/detekt-baseline.xml")
// "detekt-baseline.xml"
dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.1")
}
}
}
idea {
module {
isDownloadSources = true
}
}