Skip to content

Commit 32cdcfb

Browse files
committed
[Truffle] FindBugs for Truffle.
1 parent d82038e commit 32cdcfb

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,8 @@ core/.gitignore
9999
core/.project
100100
core/.settings
101101
core/.apt_generated
102+
103+
# Truffle findbugs
104+
truffle-findbugs-report.html
105+
findbugs-noUpdateChecks-3.0.0.tar.gz
106+
findbugs-3.0.0

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,15 @@ matrix:
6262
jdk: oraclejdk8
6363
- env: COMMAND=test/check_versions.sh
6464
jdk: oraclejdk8
65+
- env: COMMAND=tool/truffle-findbugs.sh
66+
jdk: oraclejdk8
6567
fast_finish: true
6668
allow_failures:
6769
- env: PHASE='-Pcomplete'
6870
- env: PHASE='-Prake -Dtask=spec:jrubyc'
6971
- env: PHASE='-Prake -Dtask=spec:profiler'
7072
- env: PHASE='-Ptruffle-specs-rubysl'
73+
- env: COMMAND=tool/truffle-findbugs.sh
7174

7275
branches:
7376
only:

tool/truffle-findbugs-exclude.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<FindBugsFilter>
3+
<Match>
4+
<Class name="~.*NodeFactory.*" />
5+
</Match>
6+
</FindBugsFilter>

tool/truffle-findbugs.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
# Runs findbugs for the Truffle classes only. By default writes to stdout. Use
4+
# with --report to get a HTML report.
5+
6+
if [[ $* == *--report* ]]
7+
then
8+
ui_options="-html -output truffle-findbugs-report.html"
9+
else
10+
ui_options=""
11+
fi
12+
13+
mvn package || exit $?
14+
15+
version=3.0.0
16+
shasum=30bdcee2c909a0eef61a4f60f4489cd2f5a4d21c
17+
tarball=findbugs-noUpdateChecks-$version.tar.gz
18+
19+
if [ ! -e findbugs-$version ]
20+
then
21+
wget http://prdownloads.sourceforge.net/findbugs/$tarball || exit $?
22+
echo "$shasum $tarball" | shasum -c || exit $?
23+
tar -xf $tarball || exit $?
24+
fi
25+
26+
findbugs-3.0.0/bin/findbugs \
27+
-textui $ui_options \
28+
-exclude tool/truffle-findbugs-exclude.xml \
29+
-exitcode \
30+
-low \
31+
core/target/classes/org/jruby/truffle/ || exit $?

0 commit comments

Comments
 (0)