| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 parser.add_argument('--src-dirs', | 283 parser.add_argument('--src-dirs', |
| 284 help='Directories containing java files.') | 284 help='Directories containing java files.') |
| 285 parser.add_argument('--stamp', | 285 parser.add_argument('--stamp', |
| 286 help='Path to touch on success.') | 286 help='Path to touch on success.') |
| 287 | 287 |
| 288 args = parser.parse_args(build_utils.ExpandFileArgs(sys.argv[1:])) | 288 args = parser.parse_args(build_utils.ExpandFileArgs(sys.argv[1:])) |
| 289 | 289 |
| 290 if args.enable: | 290 if args.enable: |
| 291 sources = [] | 291 sources = [] |
| 292 if args.src_dirs: | 292 if args.src_dirs: |
| 293 src_dirs = build_utils.ParseGypList(args.src_dirs) | 293 src_dirs = build_utils.ParseGnList(args.src_dirs) |
| 294 sources = build_utils.FindInDirectories(src_dirs, '*.java') | 294 sources = build_utils.FindInDirectories(src_dirs, '*.java') |
| 295 elif args.java_sources_file: | 295 elif args.java_sources_file: |
| 296 sources.extend(build_utils.ReadSourcesList(args.java_sources_file)) | 296 sources.extend(build_utils.ReadSourcesList(args.java_sources_file)) |
| 297 | 297 |
| 298 if args.config_path and not args.processed_config_path: | 298 if args.config_path and not args.processed_config_path: |
| 299 parser.error('--config-path specified without --processed-config-path') | 299 parser.error('--config-path specified without --processed-config-path') |
| 300 elif args.processed_config_path and not args.config_path: | 300 elif args.processed_config_path and not args.config_path: |
| 301 parser.error('--processed-config-path specified without --config-path') | 301 parser.error('--processed-config-path specified without --config-path') |
| 302 | 302 |
| 303 input_paths = [ | 303 input_paths = [ |
| 304 args.lint_path, | 304 args.lint_path, |
| 305 args.platform_xml_path, | 305 args.platform_xml_path, |
| 306 ] | 306 ] |
| 307 if args.config_path: | 307 if args.config_path: |
| 308 input_paths.append(args.config_path) | 308 input_paths.append(args.config_path) |
| 309 if args.jar_path: | 309 if args.jar_path: |
| 310 input_paths.append(args.jar_path) | 310 input_paths.append(args.jar_path) |
| 311 if args.manifest_path: | 311 if args.manifest_path: |
| 312 input_paths.append(args.manifest_path) | 312 input_paths.append(args.manifest_path) |
| 313 if sources: | 313 if sources: |
| 314 input_paths.extend(sources) | 314 input_paths.extend(sources) |
| 315 classpath = [] | 315 classpath = [] |
| 316 for gyp_list in args.classpath: | 316 for gyp_list in args.classpath: |
| 317 classpath.extend(build_utils.ParseGypList(gyp_list)) | 317 classpath.extend(build_utils.ParseGnList(gyp_list)) |
| 318 input_paths.extend(classpath) | 318 input_paths.extend(classpath) |
| 319 | 319 |
| 320 resource_sources = [] | 320 resource_sources = [] |
| 321 if args.resource_dir: | 321 if args.resource_dir: |
| 322 # Backward compatibility with GYP | 322 # Backward compatibility with GYP |
| 323 resource_sources += [ args.resource_dir ] | 323 resource_sources += [ args.resource_dir ] |
| 324 | 324 |
| 325 for gyp_list in args.resource_sources: | 325 for gyp_list in args.resource_sources: |
| 326 resource_sources += build_utils.ParseGypList(gyp_list) | 326 resource_sources += build_utils.ParseGnList(gyp_list) |
| 327 | 327 |
| 328 for resource_source in resource_sources: | 328 for resource_source in resource_sources: |
| 329 if os.path.isdir(resource_source): | 329 if os.path.isdir(resource_source): |
| 330 input_paths.extend(build_utils.FindInDirectory(resource_source, '*')) | 330 input_paths.extend(build_utils.FindInDirectory(resource_source, '*')) |
| 331 else: | 331 else: |
| 332 input_paths.append(resource_source) | 332 input_paths.append(resource_source) |
| 333 | 333 |
| 334 input_strings = [] | 334 input_strings = [] |
| 335 if args.android_sdk_version: | 335 if args.android_sdk_version: |
| 336 input_strings.append(args.android_sdk_version) | 336 input_strings.append(args.android_sdk_version) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 354 silent=args.silent), | 354 silent=args.silent), |
| 355 args, | 355 args, |
| 356 input_paths=input_paths, | 356 input_paths=input_paths, |
| 357 input_strings=input_strings, | 357 input_strings=input_strings, |
| 358 output_paths=output_paths, | 358 output_paths=output_paths, |
| 359 depfile_deps=classpath) | 359 depfile_deps=classpath) |
| 360 | 360 |
| 361 | 361 |
| 362 if __name__ == '__main__': | 362 if __name__ == '__main__': |
| 363 sys.exit(main()) | 363 sys.exit(main()) |
| OLD | NEW |