-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
101 lines (86 loc) · 2.94 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
import com.vanniktech.maven.publish.SonatypeHost
plugins {
kotlin("jvm") version "2.0.21"
alias(libs.plugins.detekt)
jacoco
id("com.github.ben-manes.versions") version "0.51.0"
id("com.vanniktech.maven.publish") version "0.30.0"
}
group = "me.haroldmartin.detektrules"
version = "0.1.7"
dependencies {
compileOnly(libs.detekt.api)
testImplementation(libs.detekt.test)
testImplementation("io.kotest:kotest-assertions-core:5.9.1")
testImplementation("org.junit.jupiter:junit-jupiter:5.11.0")
testImplementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.8")
detektPlugins(libs.detekt.formatting)
detektPlugins(libs.detekt.ruleauthors)
detektPlugins(rootProject)
}
kotlin {
jvmToolchain(11)
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
systemProperty("junit.jupiter.testinstance.lifecycle.default", "per_class")
systemProperty("compile-snippet-tests", project.hasProperty("compile-test-snippets"))
}
tasks.jacocoTestReport {
dependsOn(tasks.test) // tests are required to run before generating the report
reports {
xml.required.set(true)
csv.required.set(false)
html.required.set(false)
}
}
mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
if (properties["jitpack"] != "true") {
signAllPublications()
coordinates("me.haroldmartin", "hbmartin-detekt-rules", version as String)
} else {
coordinates("me.haroldmartin.detektrules", "hbmartin-detekt-rules", version as String)
}
pom {
name.set("Hbmartin's Detekt Rules")
description.set("A somewhat opinionated ruleset for Detekt, primarily intended to avoid crashes and bugs related to mutability.")
inceptionYear.set("2023")
url.set("https://github.com/hbmartin/hbmartin-detekt-rules")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("hmartin")
name.set("Harold Martin")
url.set("https://github.com/hbmartin/")
}
}
scm {
url.set("https://github.com/hbmartin/hbmartin-detekt-rules/")
connection.set("scm:git:git://github.com/hbmartin/hbmartin-detekt-rules.git")
developerConnection.set("scm:git:ssh://[email protected]/hbmartin/hbmartin-detekt-rules.git")
}
}
}
detekt {
allRules = true
}
tasks.withType<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask> {
checkForGradleUpdate = true
rejectVersionIf {
listOf("-RC", "-Beta", "-M1", "-M2").any { word ->
candidate.version.contains(word)
}
}
}
task("printVersion") {
doLast {
print(version)
}
}