Merge action into an existing list of actions. Care must be taken so that actions which have overlapping inputs either don't get assigned to the same input, or get collapsed into one. Arguments: actions_dict: dictionary keyed on input name, which maps to a list of dicts d
(actions_dict, inputs, outputs, description, command)
| 455 | |
| 456 | |
| 457 | def _AddActionStep(actions_dict, inputs, outputs, description, command): |
| 458 | """Merge action into an existing list of actions. |
| 459 | |
| 460 | Care must be taken so that actions which have overlapping inputs either don't |
| 461 | get assigned to the same input, or get collapsed into one. |
| 462 | |
| 463 | Arguments: |
| 464 | actions_dict: dictionary keyed on input name, which maps to a list of |
| 465 | dicts describing the actions attached to that input file. |
| 466 | inputs: list of inputs |
| 467 | outputs: list of outputs |
| 468 | description: description of the action |
| 469 | command: command line to execute |
| 470 | """ |
| 471 | # Require there to be at least one input (call sites will ensure this). |
| 472 | assert inputs |
| 473 | |
| 474 | action = { |
| 475 | "inputs": inputs, |
| 476 | "outputs": outputs, |
| 477 | "description": description, |
| 478 | "command": command, |
| 479 | } |
| 480 | |
| 481 | # Pick where to stick this action. |
| 482 | # While less than optimal in terms of build time, attach them to the first |
| 483 | # input for now. |
| 484 | chosen_input = inputs[0] |
| 485 | |
| 486 | # Add it there. |
| 487 | if chosen_input not in actions_dict: |
| 488 | actions_dict[chosen_input] = [] |
| 489 | actions_dict[chosen_input].append(action) |
| 490 | |
| 491 | |
| 492 | def _AddCustomBuildToolForMSVS( |
no test coverage detected