MCPcopy Create free account
hub / github.com/nodejs/node / RootGroupForPath

Method RootGroupForPath

tools/gyp/pylib/gyp/xcodeproj_file.py:2827–2862  ·  view source on GitHub ↗

Returns a PBXGroup child of this object to which path should be added. This method is intended to choose between SourceGroup and IntermediatesGroup on the basis of whether path is present in a source directory or an intermediates directory. For the purposes of this

(self, path)

Source from the content-addressed store, hash-verified

2825 return self._GroupByName("Projects")
2826
2827 def RootGroupForPath(self, path):
2828 """Returns a PBXGroup child of this object to which path should be added.
2829
2830 This method is intended to choose between SourceGroup and
2831 IntermediatesGroup on the basis of whether path is present in a source
2832 directory or an intermediates directory. For the purposes of this
2833 determination, any path located within a derived file directory such as
2834 PROJECT_DERIVED_FILE_DIR is treated as being in an intermediates
2835 directory.
2836
2837 The returned value is a two-element tuple. The first element is the
2838 PBXGroup, and the second element specifies whether that group should be
2839 organized hierarchically (True) or as a single flat list (False).
2840 """
2841
2842 # TODO(mark): make this a class variable and bind to self on call?
2843 # Also, this list is nowhere near exhaustive.
2844 # INTERMEDIATE_DIR and SHARED_INTERMEDIATE_DIR are used by
2845 # gyp.generator.xcode. There should probably be some way for that module
2846 # to push the names in, rather than having to hard-code them here.
2847 source_tree_groups = {
2848 "DERIVED_FILE_DIR": (self.IntermediatesGroup, True),
2849 "INTERMEDIATE_DIR": (self.IntermediatesGroup, True),
2850 "PROJECT_DERIVED_FILE_DIR": (self.IntermediatesGroup, True),
2851 "SHARED_INTERMEDIATE_DIR": (self.IntermediatesGroup, True),
2852 }
2853
2854 (source_tree, path) = SourceTreeAndPathFromPath(path)
2855 if source_tree is not None and source_tree in source_tree_groups:
2856 (group_func, hierarchical) = source_tree_groups[source_tree]
2857 group = group_func()
2858 return (group, hierarchical)
2859
2860 # TODO(mark): make additional choices based on file extension.
2861
2862 return (self.SourceGroup(), True)
2863
2864 def AddOrGetFileInRootGroup(self, path):
2865 """Returns a PBXFileReference corresponding to path in the correct group

Callers 6

FileGroupMethod · 0.80
FileGroupMethod · 0.80
FileGroupMethod · 0.80
FileGroupMethod · 0.80
FileGroupMethod · 0.80

Calls 2

SourceGroupMethod · 0.95

Tested by

no test coverage detected