Skip to content

Commit 6623282

Browse files
stIncMalejyemin
authored andcommitted
Add ssdlc-report.sh that uses SpotBugs to create SARIF files (#1401)
In the future this script may do more work for us. JAVA-5431
1 parent 9ad6daf commit 6623282

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.evergreen/ssdlc-report.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
set -o errexit
4+
5+
############################################
6+
# Main Program #
7+
############################################
8+
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE[0]:-$0}")"
9+
source "${RELATIVE_DIR_PATH}/javaConfig.bash"
10+
11+
echo "Creating SSLDC reports"
12+
./gradlew -version
13+
./gradlew -PssdlcReport.enabled=true --continue -x test -x integrationTest -x spotlessApply clean check scalaCheck kotlinCheck testClasses || true
14+
echo "SpotBugs created the following SARIF files"
15+
find . -path "*/spotbugs/*.sarif"

build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,9 @@ configure(javaCodeCheckedProjects) {
337337
}
338338

339339
spotbugs {
340-
excludeFilter = new File(configDir, 'spotbugs/exclude.xml')
340+
if (!project.buildingWith('ssdlcReport.enabled')) {
341+
excludeFilter = new File(configDir, 'spotbugs/exclude.xml')
342+
}
341343
}
342344

343345
codenarc {
@@ -349,6 +351,7 @@ configure(javaCodeCheckedProjects) {
349351
reports {
350352
xml.enabled = project.buildingWith('xmlReports.enabled')
351353
html.enabled = !project.buildingWith('xmlReports.enabled')
354+
sarif.enabled = project.buildingWith('ssdlcReport.enabled')
352355
}
353356
}
354357

0 commit comments

Comments
 (0)