-
-
Notifications
You must be signed in to change notification settings - Fork 68
/
build.gradle.kts
87 lines (77 loc) · 2.55 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
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
groovy
jacoco
signing
kotlin("jvm") version "2.0.21"
id("com.android.lint") version "8.7.2"
id("org.jetbrains.dokka") version "1.9.20"
id("com.github.spotbugs.gradle-plugin")
id("com.github.spotbugs.plugin-publish")
id("com.github.spotbugs.test")
id("org.sonarqube")
id("io.gitlab.arturbosch.detekt") version "1.23.7"
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.16.3"
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
group = "com.github.spotbugs.snom"
val spotBugsVersion = "4.8.6"
val slf4jVersion = "2.0.0"
val androidGradlePluginVersion = "8.7.2"
dependencies {
compileOnly(localGroovy())
compileOnly("com.github.spotbugs:spotbugs:$spotBugsVersion")
compileOnly("com.android.tools.build:gradle:$androidGradlePluginVersion")
testImplementation("com.tngtech.archunit:archunit:1.3.0")
lintChecks("androidx.lint:lint-gradle:1.0.0-alpha02")
}
val signingKey: String? = providers.environmentVariable("SIGNING_KEY").orNull
val signingPassword: String? = providers.environmentVariable("SIGNING_PASSWORD").orNull
signing {
if (!signingKey.isNullOrBlank() && !signingPassword.isNullOrBlank()) {
useInMemoryPgpKeys(signingKey, signingPassword)
sign(configurations.archives.get())
} else {
logger.warn("The signing key and password are null. This can be ignored if this is a pull request.")
}
}
tasks {
withType<JavaCompile> {
options.release.set(8)
}
withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}
named<Detekt>("detekt") {
reports {
sarif.required = true
}
}
val processVersionFile by registering(WriteProperties::class) {
destinationFile = file("src/main/resources/spotbugs-gradle-plugin.properties")
property("slf4j-version", slf4jVersion)
property("spotbugs-version", spotBugsVersion)
}
processResources {
dependsOn(processVersionFile)
}
withType<Jar>().configureEach {
dependsOn(processResources)
}
withType<DokkaTask>().configureEach {
notCompatibleWithConfigurationCache("https://github.com/Kotlin/dokka/issues/2231")
}
javadoc {
enabled = false
}
}
defaultTasks(tasks.spotlessApply.name, tasks.build.name)