OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 # |
| 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. |
| 6 |
| 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: |
| 10 |
| 11 findbugs_diff.py --rebaseline |
| 12 |
| 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). |
| 16 |
| 17 Other options |
| 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. |
| 21 |
| 22 Run |
| 23 $CHROM_SRC/third_party/findbugs/bin/findbugs -textui for details. |
| 24 |
| 25 """ |
| 26 |
| 27 import optparse |
| 28 import os |
| 29 import sys |
| 30 |
| 31 from pylib import findbugs |
| 32 |
| 33 |
| 34 def main(argv): |
| 35 parser = findbugs.GetCommonParser() |
| 36 |
| 37 options, _ = parser.parse_args() |
| 38 |
| 39 chrome_src = os.getenv('CHROME_SRC') |
| 40 |
| 41 if not options.base_dir: |
| 42 options.base_dir = os.path.join(chrome_src, 'build', 'android', |
| 43 'findbugs_filter') |
| 44 if not options.only_analyze: |
| 45 options.only_analyze = 'org.chromium.-' |
| 46 |
| 47 return findbugs.Run(options) |
| 48 |
| 49 |
| 50 if __name__ == '__main__': |
| 51 sys.exit(main(sys.argv)) |
OLD | NEW |