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

Unified Diff: pylib/gyp/common.py

Issue 2866042: Effectively duplicates targets that contain rules/actions, therefore enabling... (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: '' Created 10 years, 5 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 | pylib/gyp/generator/msvs.py » ('j') | pylib/gyp/generator/msvs.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/common.py
===================================================================
--- pylib/gyp/common.py (revision 836)
+++ pylib/gyp/common.py (working copy)
@@ -219,21 +219,21 @@
encoded_arguments.append(EncodePOSIXShellArgument(argument))
return ' '.join(encoded_arguments)
-
-def DeepDependencyTargets(target_dicts, roots):
+def DeepDependencyTargets(target_dicts, roots, dependencies=None):
Mark Mentovai 2010/07/07 17:45:28 Could you explain what’s going on in this function
"""Returns the recursive list of target dependencies.
"""
- dependencies = set()
+ dependencies = dependencies or set()
+ unseen_deps = []
for r in roots:
spec = target_dicts[r]
r_deps = list(set((spec.get('dependencies', []) +
spec.get('dependencies_original', []))))
for d in r_deps:
- if d not in roots:
+ if d not in dependencies and d not in roots:
dependencies.add(d)
- for d in DeepDependencyTargets(target_dicts, r_deps):
- if d not in roots:
- dependencies.add(d)
+ unseen_deps.append(d)
+ if unseen_deps:
+ DeepDependencyTargets(target_dicts, unseen_deps, dependencies)
return list(dependencies)
« no previous file with comments | « no previous file | pylib/gyp/generator/msvs.py » ('j') | pylib/gyp/generator/msvs.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698