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

Function _RuleExpandPath

tools/gyp/pylib/gyp/generator/msvs.py:557–575  ·  view source on GitHub ↗

Given the input file to which a rule applied, string substitute a path. Arguments: path: a path to string expand input_file: the file to which the rule applied. Returns: The string substituted path.

(path, input_file)

Source from the content-addressed store, hash-verified

555
556
557def _RuleExpandPath(path, input_file):
558 """Given the input file to which a rule applied, string substitute a path.
559
560 Arguments:
561 path: a path to string expand
562 input_file: the file to which the rule applied.
563 Returns:
564 The string substituted path.
565 """
566 path = path.replace(
567 "$(InputName)", os.path.splitext(os.path.split(input_file)[1])[0]
568 )
569 path = path.replace("$(InputDir)", os.path.dirname(input_file))
570 path = path.replace(
571 "$(InputExt)", os.path.splitext(os.path.split(input_file)[1])[1]
572 )
573 path = path.replace("$(InputFileName)", os.path.split(input_file)[1])
574 path = path.replace("$(InputPath)", input_file)
575 return path
576
577
578def _FindRuleTriggerFiles(rule, sources):

Callers 2

_RuleInputsAndOutputsFunction · 0.85
_GenerateExternalRulesFunction · 0.85

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected