forked from spotbugs/spotbugs-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
76 lines (67 loc) · 2.09 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
plugins {
groovy
`java-gradle-plugin`
jacoco
signing
id("com.github.spotbugs.gradle-plugin")
id("com.github.spotbugs.plugin-publish")
id("com.github.spotbugs.test")
id("org.sonarqube")
id("com.github.spotbugs") version "5.0.14"
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
group = "com.github.spotbugs.snom"
repositories {
// To download the Android Gradle Plugin
google()
// To download trove4j required by the Android Gradle Plugin
mavenCentral()
}
val errorproneVersion = "2.20.0"
val spotBugsVersion = "4.7.3"
val slf4jVersion = "2.0.0"
val androidGradlePluginVersion = "7.3.1"
dependencies {
errorprone("com.google.errorprone:error_prone_core:$errorproneVersion")
compileOnly(localGroovy())
compileOnly("com.github.spotbugs:spotbugs:$spotBugsVersion")
compileOnly("com.android.tools.build:gradle:$androidGradlePluginVersion")
testImplementation("com.tngtech.archunit:archunit:1.0.1")
}
val signingKey: String? = System.getenv("SIGNING_KEY")
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
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.")
}
}
spotbugs {
ignoreFailures.set(true)
}
tasks {
named<com.github.spotbugs.snom.SpotBugsTask>("spotbugsMain") {
reports {
register("sarif") {
required.set(true)
}
}
}
val processVersionFile by registering(WriteProperties::class) {
outputFile = file("src/main/resources/spotbugs-gradle-plugin.properties")
property("slf4j-version", slf4jVersion)
property("spotbugs-version", spotBugsVersion)
}
named("processResources") {
dependsOn(processVersionFile)
}
withType<Jar> {
dependsOn(processResources)
}
}
defaultTasks("spotlessApply", "build")