3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
7 """Runs findbugs, and returns an error code if there are new warnings.
8 This runs findbugs with an additional flag to exclude known bugs.
9 To update the list of known bugs, do this:
11 findbugs_diff.py --rebaseline
13 Note that this is separate from findbugs_exclude.xml. The "exclude" file has
14 false positives that we do not plan to fix. The "known bugs" file has real
15 bugs that we *do* plan to fix (but haven't done so yet).
18 --only-analyze used to only analyze the class you are interested.
19 --relase-build analyze the classes in out/Release directory.
20 --findbugs-args used to passin other findbugs's options.
23 $CHROM_SRC/third_party/findbugs/bin/findbugs -textui for details.
30 from pylib
import constants
31 from pylib
.utils
import findbugs
35 parser
= findbugs
.GetCommonParser()
37 options
, _
= parser
.parse_args()
39 if not options
.base_dir
:
40 options
.base_dir
= os
.path
.join(constants
.DIR_SOURCE_ROOT
, 'build',
41 'android', 'findbugs_filter')
42 if not options
.only_analyze
:
43 options
.only_analyze
= 'org.chromium.-'
45 return findbugs
.Run(options
)
48 if __name__
== '__main__':