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)
| 555 | |
| 556 | |
| 557 | def _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 | |
| 578 | def _FindRuleTriggerFiles(rule, sources): |
no test coverage detected