Skip to content

Commit

Permalink
[Truffle] FindBugs for Truffle.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Jan 5, 2015
1 parent d82038e commit 32cdcfb
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,8 @@ core/.gitignore
core/.project
core/.settings
core/.apt_generated

# Truffle findbugs
truffle-findbugs-report.html
findbugs-noUpdateChecks-3.0.0.tar.gz
findbugs-3.0.0
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,15 @@ matrix:
jdk: oraclejdk8
- env: COMMAND=test/check_versions.sh
jdk: oraclejdk8
- env: COMMAND=tool/truffle-findbugs.sh
jdk: oraclejdk8
fast_finish: true
allow_failures:
- env: PHASE='-Pcomplete'
- env: PHASE='-Prake -Dtask=spec:jrubyc'
- env: PHASE='-Prake -Dtask=spec:profiler'
- env: PHASE='-Ptruffle-specs-rubysl'
- env: COMMAND=tool/truffle-findbugs.sh

branches:
only:
Expand Down
6 changes: 6 additions & 0 deletions tool/truffle-findbugs-exclude.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FindBugsFilter>
<Match>
<Class name="~.*NodeFactory.*" />
</Match>
</FindBugsFilter>
31 changes: 31 additions & 0 deletions tool/truffle-findbugs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# Runs findbugs for the Truffle classes only. By default writes to stdout. Use
# with --report to get a HTML report.

if [[ $* == *--report* ]]
then
ui_options="-html -output truffle-findbugs-report.html"
else
ui_options=""
fi

mvn package || exit $?

version=3.0.0
shasum=30bdcee2c909a0eef61a4f60f4489cd2f5a4d21c
tarball=findbugs-noUpdateChecks-$version.tar.gz

if [ ! -e findbugs-$version ]
then
wget http://prdownloads.sourceforge.net/findbugs/$tarball || exit $?
echo "$shasum $tarball" | shasum -c || exit $?
tar -xf $tarball || exit $?
fi

findbugs-3.0.0/bin/findbugs \
-textui $ui_options \
-exclude tool/truffle-findbugs-exclude.xml \
-exitcode \
-low \
core/target/classes/org/jruby/truffle/ || exit $?

0 comments on commit 32cdcfb

Please sign in to comment.