Skip to content

Commit 01ba99d

Browse files
authored
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 a34cb31 commit 01ba99d

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
@@ -338,7 +338,9 @@ configure(javaCodeCheckedProjects) {
338338
}
339339

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

344346
codenarc {
@@ -350,6 +352,7 @@ configure(javaCodeCheckedProjects) {
350352
reports {
351353
xml.enabled = project.buildingWith('xmlReports.enabled')
352354
html.enabled = !project.buildingWith('xmlReports.enabled')
355+
sarif.enabled = project.buildingWith('ssdlcReport.enabled')
353356
}
354357
}
355358

0 commit comments

Comments
 (0)