OLD | NEW |
---|---|
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 Loading... | |
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. | |
Dirk Pranke
2016/01/29 21:01:56
ick. I suppose fixing the CastShell is part of thi
brettw
2016/01/29 21:10:21
I started doing this and got super confused. The A
Dirk Pranke
2016/01/29 21:38:42
Okay, maybe slan@ can help us get that part straig
slan
2016/01/29 22:37:56
Sure. Brett, to which script are you referring?
| |
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 Loading... | |
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 |
OLD | NEW |