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

Side by Side Diff: pylib/gyp/input.py

Issue 27353003: Adds the ability to skip includes. (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Created 7 years, 2 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 | « pylib/gyp/generator/ninja.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 Google Inc. All rights reserved. 1 # Copyright (c) 2012 Google Inc. 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 from compiler.ast import Const 5 from compiler.ast import Const
6 from compiler.ast import Dict 6 from compiler.ast import Dict
7 from compiler.ast import Discard 7 from compiler.ast import Discard
8 from compiler.ast import List 8 from compiler.ast import List
9 from compiler.ast import Module 9 from compiler.ast import Module
10 from compiler.ast import Node 10 from compiler.ast import Node
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 gyp.common.ExceptionAppend(e, 'while reading ' + build_file_path) 222 gyp.common.ExceptionAppend(e, 'while reading ' + build_file_path)
223 raise 223 raise
224 224
225 if not isinstance(build_file_data, dict): 225 if not isinstance(build_file_data, dict):
226 raise GypError("%s does not evaluate to a dictionary." % build_file_path) 226 raise GypError("%s does not evaluate to a dictionary." % build_file_path)
227 227
228 data[build_file_path] = build_file_data 228 data[build_file_path] = build_file_data
229 aux_data[build_file_path] = {} 229 aux_data[build_file_path] = {}
230 230
231 # Scan for includes and merge them in. 231 # Scan for includes and merge them in.
232 try: 232 if ('skip_includes' not in build_file_data or
233 if is_target: 233 not build_file_data['skip_includes']):
Nico 2013/10/15 17:12:50 This maybe doesn't have to be so general. Your gen
brettw 2013/10/15 17:20:02 GYP files that depend on this would just name the
234 LoadBuildFileIncludesIntoDict(build_file_data, build_file_path, data, 234 try:
235 aux_data, variables, includes, check) 235 if is_target:
236 else: 236 LoadBuildFileIncludesIntoDict(build_file_data, build_file_path, data,
237 LoadBuildFileIncludesIntoDict(build_file_data, build_file_path, data, 237 aux_data, variables, includes, check)
238 aux_data, variables, None, check) 238 else:
239 except Exception, e: 239 LoadBuildFileIncludesIntoDict(build_file_data, build_file_path, data,
240 gyp.common.ExceptionAppend(e, 240 aux_data, variables, None, check)
241 'while reading includes of ' + build_file_path) 241 except Exception, e:
242 raise 242 gyp.common.ExceptionAppend(e,
243 'while reading includes of ' + build_file_path)
244 raise
243 245
244 return build_file_data 246 return build_file_data
245 247
246 248
247 def LoadBuildFileIncludesIntoDict(subdict, subdict_path, data, aux_data, 249 def LoadBuildFileIncludesIntoDict(subdict, subdict_path, data, aux_data,
248 variables, includes, check): 250 variables, includes, check):
249 includes_list = [] 251 includes_list = []
250 if includes != None: 252 if includes != None:
251 includes_list.extend(includes) 253 includes_list.extend(includes)
252 if 'includes' in subdict: 254 if 'includes' in subdict:
(...skipping 2489 matching lines...) Expand 10 before | Expand all | Expand 10 after
2742 ValidateRunAsInTarget(target, target_dict, build_file) 2744 ValidateRunAsInTarget(target, target_dict, build_file)
2743 ValidateActionsInTarget(target, target_dict, build_file) 2745 ValidateActionsInTarget(target, target_dict, build_file)
2744 2746
2745 # Generators might not expect ints. Turn them into strs. 2747 # Generators might not expect ints. Turn them into strs.
2746 TurnIntIntoStrInDict(data) 2748 TurnIntIntoStrInDict(data)
2747 2749
2748 # TODO(mark): Return |data| for now because the generator needs a list of 2750 # TODO(mark): Return |data| for now because the generator needs a list of
2749 # build files that came in. In the future, maybe it should just accept 2751 # build files that came in. In the future, maybe it should just accept
2750 # a list, and not the whole data dict. 2752 # a list, and not the whole data dict.
2751 return [flat_list, targets, data] 2753 return [flat_list, targets, data]
OLDNEW
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698