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

Side by Side Diff: build/android/gyp/util/build_utils.py

Issue 1618243004: Use gn_helpers to deserialize GN lists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | build/config/zip.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import ast 5 import ast
6 import contextlib 6 import contextlib
7 import fnmatch 7 import fnmatch
8 import json 8 import json
9 import os 9 import os
10 import pipes 10 import pipes
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 71
72 def FindInDirectories(directories, filename_filter): 72 def FindInDirectories(directories, filename_filter):
73 all_files = [] 73 all_files = []
74 for directory in directories: 74 for directory in directories:
75 all_files.extend(FindInDirectory(directory, filename_filter)) 75 all_files.extend(FindInDirectory(directory, filename_filter))
76 return all_files 76 return all_files
77 77
78 78
79 def ParseGnList(gn_string): 79 def ParseGnList(gn_string):
80 # TODO(brettw) bug 573132: This doesn't handle GN escaping properly, so any
81 # weird characters like $ or \ in the strings will be corrupted.
82 #
83 # The code should import build/gn_helpers.py and then do:
84 # parser = gn_helpers.GNValueParser(gn_string)
85 # return return parser.ParseList()
86 # As of this writing, though, there is a CastShell build script that sends
87 # JSON through this function, and using correct GN parsing corrupts that.
88 #
89 # We need to be consistent about passing either JSON or GN lists through
90 # this function.
80 return ast.literal_eval(gn_string) 91 return ast.literal_eval(gn_string)
81 92
82 93
83 def ParseGypList(gyp_string): 94 def ParseGypList(gyp_string):
84 # The ninja generator doesn't support $ in strings, so use ## to 95 # The ninja generator doesn't support $ in strings, so use ## to
85 # represent $. 96 # represent $.
86 # TODO(cjhopman): Remove when 97 # TODO(cjhopman): Remove when
87 # https://code.google.com/p/gyp/issues/detail?id=327 98 # https://code.google.com/p/gyp/issues/detail?id=327
88 # is addressed. 99 # is addressed.
89 gyp_string = gyp_string.replace('##', '$') 100 gyp_string = gyp_string.replace('##', '$')
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 487
477 md5_check.CallAndRecordIfStale( 488 md5_check.CallAndRecordIfStale(
478 on_stale_md5, 489 on_stale_md5,
479 record_path=record_path, 490 record_path=record_path,
480 input_paths=input_paths, 491 input_paths=input_paths,
481 input_strings=input_strings, 492 input_strings=input_strings,
482 output_paths=output_paths, 493 output_paths=output_paths,
483 force=force, 494 force=force,
484 pass_changes=True) 495 pass_changes=True)
485 496
OLDNEW
« no previous file with comments | « no previous file | build/config/zip.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698