(step: str, prev_step: Optional[str] = None)
| 722 | n.newline() |
| 723 | |
| 724 | def write_custom_step(step: str, prev_step: Optional[str] = None) -> None: |
| 725 | implicit: List[str | Path] = [] |
| 726 | if config.custom_build_steps and step in config.custom_build_steps: |
| 727 | n.comment(f"Custom build steps ({step})") |
| 728 | for custom_step in config.custom_build_steps[step]: |
| 729 | outputs = cast(List[str | Path], custom_step.get("outputs")) |
| 730 | |
| 731 | if isinstance(outputs, list): |
| 732 | implicit.extend(outputs) |
| 733 | else: |
| 734 | implicit.append(outputs) |
| 735 | |
| 736 | n.build( |
| 737 | outputs=outputs, |
| 738 | rule=cast(str, custom_step.get("rule")), |
| 739 | inputs=custom_step.get("inputs", None), |
| 740 | implicit=custom_step.get("implicit", None), |
| 741 | order_only=custom_step.get("order_only", None), |
| 742 | variables=custom_step.get("variables", None), |
| 743 | implicit_outputs=custom_step.get("implicit_outputs", None), |
| 744 | pool=custom_step.get("pool", None), |
| 745 | dyndep=custom_step.get("dyndep", None), |
| 746 | ) |
| 747 | n.newline() |
| 748 | n.build( |
| 749 | outputs=step, |
| 750 | rule="phony", |
| 751 | inputs=implicit, |
| 752 | order_only=prev_step, |
| 753 | ) |
| 754 | |
| 755 | n.comment("Host build") |
| 756 | n.variable("host_cflags", "-I include -Wno-trigraphs") |
no test coverage detected