Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pipeline {
recordIssues tool: javaDoc()
step([$class: 'JavadocArchiver', javadocDir: 'engine/build/docs/javadoc', keepAll: false])
recordIssues tool: checkStyle(pattern: '**/build/reports/checkstyle/*.xml')
recordIssues tool: findBugs(pattern: '**/build/reports/findbugs/*.xml', useRankAsPriority: true)
recordIssues tool: errorProne()
recordIssues tool: pmdParser(pattern: '**/build/reports/pmd/*.xml')
recordIssues tool: taskScanner(includePattern: '**/*.java,**/*.groovy,**/*.gradle', lowTags: 'WIBNIF', normalTags: 'TODO', highTags: 'ASAP')
}
Expand Down
2 changes: 1 addition & 1 deletion build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {

dependencies {
implementation("com.google.code.gson:gson:2.10.1")
implementation("com.github.spotbugs.snom:spotbugs-gradle-plugin:5.2.3")
implementation("net.ltgt.gradle:gradle-errorprone-plugin:5.1.0")
implementation("ru.vyarus:gradle-animalsniffer-plugin:2.0.1")
implementation("de.undercouch:gradle-download-task:5.7.0")
implementation("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:1.4.1")
Expand Down
30 changes: 13 additions & 17 deletions build-logic/src/main/kotlin/terasology-metrics.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import com.github.spotbugs.snom.SpotBugsTask
import net.ltgt.gradle.errorprone.errorprone

plugins {
java
id("project-report")
checkstyle
pmd
id("com.github.spotbugs")
id("net.ltgt.errorprone")
jacoco
id("ru.vyarus.animalsniffer")
}
Expand All @@ -21,6 +21,11 @@ dependencies {
"pmd"("net.sourceforge.pmd:pmd-java:7.26.0")

"signature"("com.toasttab.android:gummy-bears-api-24:0.15.0:coreLib2@signature")

// Pinned to the last release that still runs on JDK 17 (2.43.0+ requires JDK 21+ to run the
// analyzer itself, independent of this project's own --release 17 compile target) since the
// Jenkins CI agent's JDK version isn't controlled from this repo.
errorprone("com.google.errorprone:error_prone_core:2.42.0")
}

animalsniffer {
Expand Down Expand Up @@ -57,15 +62,12 @@ pmd {
ruleSets = listOf()
}

spotbugs {
toolVersion.set("4.8.1")
ignoreFailures.set(true)
excludeFilter.set(File(rootDir, "config/metrics/findbugs/findbugs-exclude.xml"))
}
tasks.named<SpotBugsTask>("spotbugsMain") {
reports.create("xml") {
enabled = true
outputLocation.set(file("$buildDir/reports/spotbugs/main/spotbugs.xml"))
tasks.withType<JavaCompile>().configureEach {
options.errorprone {
// Match the ignoreFailures = true posture of checkstyle/pmd above: Error Prone's ERROR-severity
// checks fail the build by default, which none of the other analyzers here do.
allErrorsAsWarnings.set(true)
disableWarningsInGeneratedCode.set(true)
}
}

Expand All @@ -76,7 +78,6 @@ val extractMetricsConfig = rootProject.tasks.findByName("extractMetricsConfig")
into("$rootDir/config/metrics")
}.get()

tasks.named("spotbugsMain") { dependsOn(extractMetricsConfig) }
tasks.named("pmdMain") { dependsOn(extractMetricsConfig) }

tasks.withType<Checkstyle>().configureEach {
Expand All @@ -89,11 +90,6 @@ tasks.withType<Pmd>().configureEach {
group = "Reporting"
}

tasks.withType<SpotBugsTask>().configureEach {
dependsOn(extractMetricsConfig)
group = "Reporting"
}

tasks.check {
dependsOn(extractMetricsConfig)
}