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

Method __init__

tools/gyp/pylib/gyp/generator/msvs.py:2389–2425  ·  view source on GitHub ↗
(self, rule, spec)

Source from the content-addressed store, hash-verified

2387 """
2388
2389 def __init__(self, rule, spec):
2390 self.display_name = rule["rule_name"]
2391 # Assure that the rule name is only characters and numbers
2392 self.rule_name = re.sub(r"\W", "_", self.display_name)
2393 # Create the various element names, following the example set by the
2394 # Visual Studio 2008 to 2010 conversion. I don't know if VS2010
2395 # is sensitive to the exact names.
2396 self.target_name = "_" + self.rule_name
2397 self.after_targets = self.rule_name + "AfterTargets"
2398 self.before_targets = self.rule_name + "BeforeTargets"
2399 self.depends_on = self.rule_name + "DependsOn"
2400 self.compute_output = "Compute%sOutput" % self.rule_name
2401 self.dirs_to_make = self.rule_name + "DirsToMake"
2402 self.inputs = self.rule_name + "_inputs"
2403 self.tlog = self.rule_name + "_tlog"
2404 self.extension = rule["extension"]
2405 if not self.extension.startswith("."):
2406 self.extension = "." + self.extension
2407
2408 self.description = MSVSSettings.ConvertVCMacrosToMSBuild(
2409 rule.get("message", self.rule_name)
2410 )
2411 old_additional_dependencies = _FixPaths(rule.get("inputs", []))
2412 self.additional_dependencies = ";".join(
2413 [
2414 MSVSSettings.ConvertVCMacrosToMSBuild(i)
2415 for i in old_additional_dependencies
2416 ]
2417 )
2418 old_outputs = _FixPaths(rule.get("outputs", []))
2419 self.outputs = ";".join(
2420 [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in old_outputs]
2421 )
2422 old_command = _BuildCommandLineForRule(
2423 spec, rule, has_input_path=True, do_setup_env=True
2424 )
2425 self.command = MSVSSettings.ConvertVCMacrosToMSBuild(old_command)
2426
2427
2428def _GenerateMSBuildRulePropsFile(props_path, msbuild_rules):

Callers

nothing calls this directly

Calls 4

_FixPathsFunction · 0.85
_BuildCommandLineForRuleFunction · 0.85
getMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected