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

Unified Diff: pylib/gyp/input.py

Issue 2094021: Raise an error when a configuration dictionary contains invalid keys.... (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: '' Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/configurations/invalid/actions.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/input.py
===================================================================
--- pylib/gyp/input.py (revision 826)
+++ pylib/gyp/input.py (working copy)
@@ -95,6 +95,20 @@
]
non_configuration_keys = []
+# Keys that do not belong inside a configuration dictionary.
+invalid_configuration_keys = [
+ 'actions',
+ 'all_dependent_settings',
+ 'configurations',
+ 'dependencies',
+ 'direct_dependent_settings',
+ 'libraries',
+ 'link_settings',
+ 'sources',
+ 'target_name',
+ 'type',
+]
+
# Controls how the generator want the build file paths.
absolute_build_file_paths = False
@@ -1784,7 +1798,16 @@
for key in delete_keys:
del target_dict[key]
+ # Check the configurations to see if they contain invalid keys.
+ for configuration in target_dict['configurations'].keys():
+ configuration_dict = target_dict['configurations'][configuration]
+ for key in configuration_dict.keys():
+ if key in invalid_configuration_keys:
+ raise KeyError, ('%s not allowed in the %s configuration, found in '
+ 'target %s' % (key, configuration, target))
+
+
def ProcessListFiltersInDict(name, the_dict):
"""Process regular expression and exclusion-based filters on lists.
« no previous file with comments | « no previous file | test/configurations/invalid/actions.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698