-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle
129 lines (109 loc) · 4.41 KB
/
build.gradle
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
117
118
119
120
121
122
123
124
125
126
127
128
129
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektPlugin
import io.gitlab.arturbosch.detekt.report.ReportMergeTask
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version "${kotlinVersion}"
id 'com.github.johnrengelman.shadow' version "${shadowVersion}"
id 'io.gitlab.arturbosch.detekt' version "${detektVersion}"
id 'net.researchgate.release' version "${releasePluginVersion}"
}
tasks.register('reportMerge', ReportMergeTask) {
output = project.layout.buildDirectory.file("reports/detekt/merge.sarif") // or "reports/detekt/merge.sarif"
}
allprojects {
apply plugin: "kotlin"
apply plugin: "io.gitlab.arturbosch.detekt"
repositories {
mavenCentral()
maven { url 'https://m2.dv8tion.net/releases' }
maven { url 'https://jitpack.io' }
maven { url "https://m2.chew.pro/releases" }
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}"
implementation "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:${kotlinCoroutinesVersion}"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-reactor:${kotlinCoroutinesVersion}"
detekt "io.gitlab.arturbosch.detekt:detekt-formatting:${detektVersion}"
detekt "io.gitlab.arturbosch.detekt:detekt-cli:${detektVersion}"
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: "${junitVersion}"
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: "${junitVersion}"
api group: 'org.slf4j', name: 'slf4j-api', version: "${slf4jVersion}"
}
test {
useJUnitPlatform()
systemProperty "junit.jupiter.testinstance.lifecycle.default", "per_class"
}
java {
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
}
kotlin {
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
}
group = "com.dongtronic.diabot"
detekt {
buildUponDefaultConfig = true // preconfigure defaults
allRules = false // activate all available (even unstable) rules.
config = files("$rootDir/config/detekt/detekt.yml")
// point to your custom config defining rules to run, overwriting default behavior
baseline = file("config/detekt/baseline.xml")
source = objects.fileCollection().from(
"src/main/java",
"src/test/java"
// "bot/src/main/java",
// "bg-graph/src/main/java",
// "nightscout-api/src/main/java",
// "utilities/src/main/java"
)
autoCorrect(true)
reports {
html.enabled = true // observe findings in your browser with structure and code snippets
xml.enabled = false // checkstyle like format mainly for integrations like Jenkins
txt.enabled = true
sarif.enabled = true
// standardized SARIF format (https://sarifweb.azurewebsites.net/) to support integrations with Github Code Scanning
// sarif {
// enabled = true
// destination = file("$rootDir/detekt.sarif.json")
// }
}
plugins.withType(DetektPlugin) {
tasks.withType(Detekt) { detektTask ->
finalizedBy(reportMerge)
reportMerge.configure { mergeTask ->
mergeTask.input.from(detektTask.sarifReportFile) // or detektTask.sarifReportFile
}
}
}
}
}
task stage(dependsOn: ["clean", "shadowJar"])
shadowJar {
exclude "logback-test.xml"
archiveBaseName.set("diabot")
archiveClassifier.set("")
archiveVersion.set("")
manifest {
attributes(
"Implementation-Title": "Diabot - a diabetes Discord bot",
"Implementation-Version": this.version,
"Main-Class": "com.dongtronic.diabot.Main",
// fixes retrofit v2.8 reflection warnings
"Add-Opens": "java.base/java.lang.invoke"
)
}
}
release {
tagTemplate = "v$version"
git {
requireBranch.set("main")
signTag.set(true)
ignoredSnapshotDependencies = ["pw.chew:jda-chewtils"]
}
}
dependencies {
implementation project(path: ":bot")
}