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

Method _GetSpecForConfiguration

tools/gyp/pylib/gyp/MSVSProject.py:92–120  ·  view source on GitHub ↗

Returns the specification for a configuration. Args: config_type: Type of configuration node. config_name: Configuration name. attrs: Dict of configuration attributes; may be None. tools: List of tools (strings or Tool objects); may be None. R

(self, config_type, config_name, attrs, tools)

Source from the content-addressed store, hash-verified

90 self.tool_files_section.append(["ToolFile", {"RelativePath": path}])
91
92 def _GetSpecForConfiguration(self, config_type, config_name, attrs, tools):
93 """Returns the specification for a configuration.
94
95 Args:
96 config_type: Type of configuration node.
97 config_name: Configuration name.
98 attrs: Dict of configuration attributes; may be None.
99 tools: List of tools (strings or Tool objects); may be None.
100 Returns:
101 """
102 # Handle defaults
103 if not attrs:
104 attrs = {}
105 if not tools:
106 tools = []
107
108 # Add configuration node and its attributes
109 node_attrs = attrs.copy()
110 node_attrs["Name"] = config_name
111 specification = [config_type, node_attrs]
112
113 # Add tool nodes and their attributes
114 if tools:
115 for t in tools:
116 if isinstance(t, Tool):
117 specification.append(t._GetSpecification())
118 else:
119 specification.append(Tool(t)._GetSpecification())
120 return specification
121
122 def AddConfig(self, name, attrs=None, tools=None):
123 """Adds a configuration to the project.

Callers 2

AddConfigMethod · 0.95
AddFileConfigMethod · 0.95

Calls 4

ToolClass · 0.85
_GetSpecificationMethod · 0.80
copyMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected