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

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

Issue 1182323007: Make DependencyGraph.DeepDependencies() depth-first. (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: doc comment Created 5 years, 6 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 | test/dependencies/adso/all_dependent_settings_order.gyp » ('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 (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 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 if dependencies is None: 1655 if dependencies is None:
1656 # Using a list to get ordered output and a set to do fast "is it 1656 # Using a list to get ordered output and a set to do fast "is it
1657 # already added" checks. 1657 # already added" checks.
1658 dependencies = OrderedSet() 1658 dependencies = OrderedSet()
1659 1659
1660 for dependency in self.dependencies: 1660 for dependency in self.dependencies:
1661 # Check for None, corresponding to the root node. 1661 # Check for None, corresponding to the root node.
1662 if dependency.ref is None: 1662 if dependency.ref is None:
1663 continue 1663 continue
1664 if dependency.ref not in dependencies: 1664 if dependency.ref not in dependencies:
1665 dependency.DeepDependencies(dependencies)
1665 dependencies.add(dependency.ref) 1666 dependencies.add(dependency.ref)
1666 dependency.DeepDependencies(dependencies)
1667 1667
1668 return dependencies 1668 return dependencies
1669 1669
1670 def _LinkDependenciesInternal(self, targets, include_shared_libraries, 1670 def _LinkDependenciesInternal(self, targets, include_shared_libraries,
1671 dependencies=None, initial=True): 1671 dependencies=None, initial=True):
1672 """Returns an OrderedSet of dependency targets that are linked 1672 """Returns an OrderedSet of dependency targets that are linked
1673 into this target. 1673 into this target.
1674 1674
1675 This function has a split personality, depending on the setting of 1675 This function has a split personality, depending on the setting of
1676 |initial|. Outside callers should always leave |initial| at its default 1676 |initial|. Outside callers should always leave |initial| at its default
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
2875 ValidateRunAsInTarget(target, target_dict, build_file) 2875 ValidateRunAsInTarget(target, target_dict, build_file)
2876 ValidateActionsInTarget(target, target_dict, build_file) 2876 ValidateActionsInTarget(target, target_dict, build_file)
2877 2877
2878 # Generators might not expect ints. Turn them into strs. 2878 # Generators might not expect ints. Turn them into strs.
2879 TurnIntIntoStrInDict(data) 2879 TurnIntIntoStrInDict(data)
2880 2880
2881 # TODO(mark): Return |data| for now because the generator needs a list of 2881 # TODO(mark): Return |data| for now because the generator needs a list of
2882 # build files that came in. In the future, maybe it should just accept 2882 # build files that came in. In the future, maybe it should just accept
2883 # a list, and not the whole data dict. 2883 # a list, and not the whole data dict.
2884 return [flat_list, targets, data] 2884 return [flat_list, targets, data]
OLDNEW
« no previous file with comments | « no previous file | test/dependencies/adso/all_dependent_settings_order.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698