OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Runs findbugs, and returns an error code if there are new warnings. | 7 """Runs findbugs, and returns an error code if there are new warnings. |
8 | 8 |
9 Other options | 9 Other options |
10 --only-analyze used to only analyze the class you are interested. | 10 --only-analyze used to only analyze the class you are interested. |
11 --relase-build analyze the classes in out/Release directory. | 11 --relase-build analyze the classes in out/Release directory. |
12 --findbugs-args used to passin other findbugs's options. | 12 --findbugs-args used to passin other findbugs's options. |
13 | 13 |
14 Run | 14 Run |
15 $CHROMIUM_SRC/third_party/findbugs/bin/findbugs -textui for details. | 15 $CHROMIUM_SRC/third_party/findbugs/bin/findbugs -textui for details. |
16 | 16 |
17 """ | 17 """ |
18 | 18 |
19 import argparse | 19 import argparse |
20 import os | 20 import os |
21 import sys | 21 import sys |
22 | 22 |
| 23 from devil.utils import run_tests_helper |
23 from pylib import constants | 24 from pylib import constants |
24 from pylib.utils import findbugs | 25 from pylib.utils import findbugs |
25 from pylib.utils import run_tests_helper | |
26 | 26 |
27 _DEFAULT_BASE_DIR = os.path.join( | 27 _DEFAULT_BASE_DIR = os.path.join( |
28 constants.DIR_SOURCE_ROOT, 'build', 'android', 'findbugs_filter') | 28 constants.DIR_SOURCE_ROOT, 'build', 'android', 'findbugs_filter') |
29 | 29 |
30 sys.path.append( | 30 sys.path.append( |
31 os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'android', 'gyp')) | 31 os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'android', 'gyp')) |
32 from util import build_utils | 32 from util import build_utils |
33 | 33 |
34 | 34 |
35 def main(): | 35 def main(): |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 + args.jar_paths) | 107 + args.jar_paths) |
108 if args.stamp: | 108 if args.stamp: |
109 build_utils.Touch(args.stamp) | 109 build_utils.Touch(args.stamp) |
110 | 110 |
111 return len(findbugs_warnings) | 111 return len(findbugs_warnings) |
112 | 112 |
113 | 113 |
114 if __name__ == '__main__': | 114 if __name__ == '__main__': |
115 sys.exit(main()) | 115 sys.exit(main()) |
116 | 116 |
OLD | NEW |