Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: build/android/gyp/lint.py

Issue 1647353002: Use gn_helpers to [se]serialize GN lists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@python_impl
Patch Set: more Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/gyp/jinja_template.py ('k') | build/android/gyp/locale_pak_resources.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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())
OLDNEW
« no previous file with comments | « build/android/gyp/jinja_template.py ('k') | build/android/gyp/locale_pak_resources.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698