parameters: (self, path)
docstring: Set the dstSubfolderSpec and dstPath properties from path.
  
      path may be specified in the same notation used for XCHierarchicalElements,
      specifically, "$(DIR)/path".
docstring_summary: Set the dstSubfolderSpec and dstPath properties from path.
docstring_tokens: Set the dstSubfolderSpec and dstPath properties from path .
function: def SetDestination(self, path):
      """Set the dstSubfolderSpec and dstPath properties from path.
  
      path may be specified in the same notation used for XCHierarchicalElements,
      specifically, "$(DIR)/path".
      """
  
      path_tree_match = self.path_tree_re.search(path)
      if path_tree_match:
        path_tree = path_tree_match.group(1);
        if path_tree in self.path_tree_first_to_subfolder:
          subfolder = self.path_tree_first_to_subfolder[path_tree]
          relative_path = path_tree_match.group(3)
          if relative_path is None:
            relative_path = ''
  
          if subfolder == 16 and path_tree_match.group(4) is not None:
            # BUILT_PRODUCTS_DIR (16) is the first element in a path whose
            # second element is possibly one of the variable names in
            # path_tree_second_to_subfolder. Xcode sets the values of all these
            # variables to relative paths so .gyp files must prefix them with
            # BUILT_PRODUCTS_DIR, e.g.
            # $(BUILT_PRODUCTS_DIR)/$(PLUGINS_FOLDER_PATH). Then
            # xcode_emulation.py can export these variables with the same values
            # as Xcode yet make & ninja files can determine the absolute path
            # to the target. Xcode uses the dstSubfolderSpec value set here
            # to determine the full path.
            #
            # An alternative of xcode_emulation.py setting the values to absolute
            # paths when exporting these variables has been ruled out because
            # then the values would be different depending on the build tool.
            #
            # Another alternative is to invent new names for the variables used
            # to match to the subfolder indices in the second table. .gyp files
            # then will not need to prepend $(BUILT_PRODUCTS_DIR) because
            # xcode_emulation.py can set the values of those variables to
            # the absolute paths when exporting. This is possibly the thinking
            # behind BUILT_FRAMEWORKS_DIR which is used in exactly this manner.
            #
            # Requiring prepending BUILT_PRODUCTS_DIR has been chosen because
            # this same way could be used to specify destinations in .gyp files
            # that pre-date this addition to GYP. However they would only work
            # with the Xcode generator. The previous version of xcode_emulation.py
            # does not export these variables. Such files will get the benefit
            # of the Xcode UI showing the proper destination name simply by
            # regenerating the projects with this version of GYP.
            path_tree = path_tree_match.group(4)
            relative_path = path_tree_match.group(6)
            separator = '/'
  
            if path_tree in self.path_tree_second_to_subfolder:
              subfolder = self.path_tree_second_to_subfolder[path_tree]
              if relative_path is None:
                relative_path = ''
                separator = ''
              if path_tree == 'XPCSERVICES_FOLDER_PATH':
                relative_path = '$(CONTENTS_FOLDER_PATH)/XPCServices' \
                                + separator + relative_path
            else:
              # subfolder = 16 from above
              # The second element of the path is an unrecognized variable.
              # Include it and any remaining elements in relative_path.
              relative_path = path_tree_match.group(3);
  
        else:
          # The path starts with an unrecognized Xcode variable
          # name like $(SRCROOT).  Xcode will still handle this
          # as an "absolute path" that starts with the variable.
          subfolder = 0
          relative_path = path
      elif path.startswith('/'):
        # Special case.  Absolute paths are in dstSubfolderSpec 0.
        subfolder = 0
        relative_path = path[1:]
      else:
        raise ValueError('Can\'t use path %s in a %s' % \
                         (path, self.__class__.__name__))
  
      self._properties['dstPath'] = relative_path
      self._properties['dstSubfolderSpec'] = subfolder
function_tokens: def SetDestination ( self , path ) : path_tree_match = self . path_tree_re . search ( path ) if path_tree_match : path_tree = path_tree_match . group ( 1 ) if path_tree in self . path_tree_first_to_subfolder : subfolder = self . path_tree_first_to_subfolder [ path_tree ] relative_path = path_tree_match . group ( 3 ) if relative_path is None : relative_path = '' if subfolder == 16 and path_tree_match . group ( 4 ) is not None : # BUILT_PRODUCTS_DIR (16) is the first element in a path whose # second element is possibly one of the variable names in # path_tree_second_to_subfolder. Xcode sets the values of all these # variables to relative paths so .gyp files must prefix them with # BUILT_PRODUCTS_DIR, e.g. # $(BUILT_PRODUCTS_DIR)/$(PLUGINS_FOLDER_PATH). Then # xcode_emulation.py can export these variables with the same values # as Xcode yet make & ninja files can determine the absolute path # to the target. Xcode uses the dstSubfolderSpec value set here # to determine the full path. # # An alternative of xcode_emulation.py setting the values to absolute # paths when exporting these variables has been ruled out because # then the values would be different depending on the build tool. # # Another alternative is to invent new names for the variables used # to match to the subfolder indices in the second table. .gyp files # then will not need to prepend $(BUILT_PRODUCTS_DIR) because # xcode_emulation.py can set the values of those variables to # the absolute paths when exporting. This is possibly the thinking # behind BUILT_FRAMEWORKS_DIR which is used in exactly this manner. # # Requiring prepending BUILT_PRODUCTS_DIR has been chosen because # this same way could be used to specify destinations in .gyp files # that pre-date this addition to GYP. However they would only work # with the Xcode generator. The previous version of xcode_emulation.py # does not export these variables. Such files will get the benefit # of the Xcode UI showing the proper destination name simply by # regenerating the projects with this version of GYP. path_tree = path_tree_match . group ( 4 ) relative_path = path_tree_match . group ( 6 ) separator = '/' if path_tree in self . path_tree_second_to_subfolder : subfolder = self . path_tree_second_to_subfolder [ path_tree ] if relative_path is None : relative_path = '' separator = '' if path_tree == 'XPCSERVICES_FOLDER_PATH' : relative_path = '$(CONTENTS_FOLDER_PATH)/XPCServices' + separator + relative_path else : # subfolder = 16 from above # The second element of the path is an unrecognized variable. # Include it and any remaining elements in relative_path. relative_path = path_tree_match . group ( 3 ) else : # The path starts with an unrecognized Xcode variable # name like $(SRCROOT).  Xcode will still handle this # as an "absolute path" that starts with the variable. subfolder = 0 relative_path = path elif path . startswith ( '/' ) : # Special case.  Absolute paths are in dstSubfolderSpec 0. subfolder = 0 relative_path = path [ 1 : ] else : raise ValueError ( 'Can\'t use path %s in a %s' % ( path , self . __class__ . __name__ ) ) self . _properties [ 'dstPath' ] = relative_path self . _properties [ 'dstSubfolderSpec' ] = subfolder