-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
116 lines (91 loc) · 2.44 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
108
109
110
111
112
113
114
115
116
import com.vanniktech.maven.publish.SonatypeHost
plugins {
alias(libs.plugins.kotlin)
alias(libs.plugins.maven.publishing)
alias(libs.plugins.detekt)
}
group = "com.faire"
version = "0.4.1"
if (!providers.environmentVariable("RELEASE").isPresent) {
val gitSha = providers.environmentVariable("GITHUB_SHA")
.orElse(
provider {
// nest the provider, we don't want to invalidate the config cache for this
providers.exec { commandLine("git", "rev-parse", "--short", "HEAD") }
.standardOutput
.asText
.map { it.trim() }
.get()
}
)
.get()
version = "$version-$gitSha-SNAPSHOT"
}
val detektVersion = libs.versions.detekt.get()
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("compiler-embeddable"))
runtimeOnly(kotlin("reflect"))
implementation(libs.detekt.api)
runtimeOnly(libs.detekt.formatting)
testImplementation(libs.assertj)
testImplementation(libs.detekt.test)
testImplementation(libs.guava)
testImplementation(libs.junit.jupiter.api)
testRuntimeOnly(libs.junit.jupiter.engine)
detektPlugins(libs.detekt.formatting)
detektPlugins(libs.detekt.ruleauthors)
detektPlugins(libs.detekt.compiler.wrapper)
detektPlugins(rootProject)
}
detekt {
parallel = true
autoCorrect = true
buildUponDefaultConfig = true
config.from(rootProject.file("detekt.yaml"))
allRules = false // activate all available (even unstable) rules.
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(8)
}
mavenPublishing {
publishToMavenCentral(SonatypeHost.DEFAULT, true)
signAllPublications()
pom {
name = "faire-detekt-rules"
description = "Detekt rules for Faire"
inceptionYear = "2023"
url = "https://github.com/Faire/faire-detekt-rules"
licenses {
license {
name = "The Apache License, Version 2.0"
distribution = "repo"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "Faire"
name = "Faire Developers"
}
}
organization {
name = "Faire"
url = "https://www.faire.com"
}
issueManagement {
system = "GitHub"
url = "https://github.com/Faire/faire-detekt-rules/issues"
}
scm {
connection = "scm:git:git://github.com/Faire/faire-detekt-rules.git"
url = "https://github.com/Faire/faire-detekt-rules"
}
}
}