| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2013 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 Android's lint tool.""" | 7 """Runs Android's lint tool.""" |
| 8 | 8 |
| 9 | 9 |
| 10 import argparse | 10 import argparse |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 help='Path to lint executable.') | 212 help='Path to lint executable.') |
| 213 parser.add_argument('--product-dir', required=True, | 213 parser.add_argument('--product-dir', required=True, |
| 214 help='Path to product dir.') | 214 help='Path to product dir.') |
| 215 parser.add_argument('--result-path', required=True, | 215 parser.add_argument('--result-path', required=True, |
| 216 help='Path to XML lint result file.') | 216 help='Path to XML lint result file.') |
| 217 parser.add_argument('--cache-dir', required=True, | 217 parser.add_argument('--cache-dir', required=True, |
| 218 help='Path to the directory in which the android cache ' | 218 help='Path to the directory in which the android cache ' |
| 219 'directory tree should be stored.') | 219 'directory tree should be stored.') |
| 220 parser.add_argument('--platform-xml-path', required=True, | 220 parser.add_argument('--platform-xml-path', required=True, |
| 221 help='Path to api-platforms.xml') | 221 help='Path to api-platforms.xml') |
| 222 parser.add_argument('--create-cache', action='store_true', | |
| 223 help='Mark the lint cache file as an output rather than ' | |
| 224 'an input.') | |
| 225 parser.add_argument('--can-fail-build', action='store_true', | 222 parser.add_argument('--can-fail-build', action='store_true', |
| 226 help='If set, script will exit with nonzero exit status' | 223 help='If set, script will exit with nonzero exit status' |
| 227 ' if lint errors are present') | 224 ' if lint errors are present') |
| 228 parser.add_argument('--config-path', | 225 parser.add_argument('--config-path', |
| 229 help='Path to lint suppressions file.') | 226 help='Path to lint suppressions file.') |
| 230 parser.add_argument('--enable', action='store_true', | 227 parser.add_argument('--enable', action='store_true', |
| 231 help='Run lint instead of just touching stamp.') | 228 help='Run lint instead of just touching stamp.') |
| 232 parser.add_argument('--jar-path', | 229 parser.add_argument('--jar-path', |
| 233 help='Jar file containing class files.') | 230 help='Jar file containing class files.') |
| 234 parser.add_argument('--java-files', | 231 parser.add_argument('--java-files', |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 input_paths.append(args.config_path) | 266 input_paths.append(args.config_path) |
| 270 if args.jar_path: | 267 if args.jar_path: |
| 271 input_paths.append(args.jar_path) | 268 input_paths.append(args.jar_path) |
| 272 if args.manifest_path: | 269 if args.manifest_path: |
| 273 input_paths.append(args.manifest_path) | 270 input_paths.append(args.manifest_path) |
| 274 if args.resource_dir: | 271 if args.resource_dir: |
| 275 input_paths.extend(build_utils.FindInDirectory(args.resource_dir, '*')) | 272 input_paths.extend(build_utils.FindInDirectory(args.resource_dir, '*')) |
| 276 if sources: | 273 if sources: |
| 277 input_paths.extend(sources) | 274 input_paths.extend(sources) |
| 278 | 275 |
| 279 input_strings = [] | 276 input_strings = [ |
| 277 args.can_fail_build, |
| 278 args.silent, |
| 279 ] |
| 280 if args.processed_config_path: | 280 if args.processed_config_path: |
| 281 input_strings.append(args.processed_config_path) | 281 input_strings.append(args.processed_config_path) |
| 282 | 282 |
| 283 output_paths = [ args.result_path ] | 283 output_paths = [ args.result_path ] |
| 284 | 284 |
| 285 build_utils.CallAndWriteDepfileIfStale( | 285 build_utils.CallAndWriteDepfileIfStale( |
| 286 lambda changes: _OnStaleMd5(changes, args.lint_path, | 286 lambda changes: _OnStaleMd5(changes, args.lint_path, |
| 287 args.config_path, | 287 args.config_path, |
| 288 args.processed_config_path, | 288 args.processed_config_path, |
| 289 args.manifest_path, args.result_path, | 289 args.manifest_path, args.result_path, |
| 290 args.product_dir, sources, | 290 args.product_dir, sources, |
| 291 args.jar_path, | 291 args.jar_path, |
| 292 args.cache_dir, | 292 args.cache_dir, |
| 293 resource_dir=args.resource_dir, | 293 resource_dir=args.resource_dir, |
| 294 can_fail_build=args.can_fail_build, | 294 can_fail_build=args.can_fail_build, |
| 295 silent=args.silent), | 295 silent=args.silent), |
| 296 args, | 296 args, |
| 297 input_paths=input_paths, | 297 input_paths=input_paths, |
| 298 input_strings=input_strings, | 298 input_strings=input_strings, |
| 299 output_paths=output_paths, | 299 output_paths=output_paths, |
| 300 pass_changes=True) | 300 pass_changes=True) |
| 301 | 301 |
| 302 | 302 |
| 303 if __name__ == '__main__': | 303 if __name__ == '__main__': |
| 304 sys.exit(main()) | 304 sys.exit(main()) |
| OLD | NEW |