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

Method AddCustomBuildRule

tools/gyp/pylib/gyp/MSVSToolFile.py:24–48  ·  view source on GitHub ↗

Adds a rule to the tool file. Args: name: Name of the rule. description: Description of the rule. cmd: Command line of the rule. additional_dependencies: other files which may trigger the rule. outputs: outputs of the rule. extensi

(
        self, name, cmd, description, additional_dependencies, outputs, extensions
    )

Source from the content-addressed store, hash-verified

22 self.rules_section = ["Rules"]
23
24 def AddCustomBuildRule(
25 self, name, cmd, description, additional_dependencies, outputs, extensions
26 ):
27 """Adds a rule to the tool file.
28
29 Args:
30 name: Name of the rule.
31 description: Description of the rule.
32 cmd: Command line of the rule.
33 additional_dependencies: other files which may trigger the rule.
34 outputs: outputs of the rule.
35 extensions: extensions handled by the rule.
36 """
37 rule = [
38 "CustomBuildRule",
39 {
40 "Name": name,
41 "ExecutionDescription": description,
42 "CommandLine": cmd,
43 "Outputs": ";".join(outputs),
44 "FileExtensions": ";".join(extensions),
45 "AdditionalDependencies": ";".join(additional_dependencies),
46 },
47 ]
48 self.rules_section.append(rule)
49
50 def WriteIfChanged(self):
51 """Writes the tool file."""

Callers 1

Calls 2

joinMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected