fester/backend/graph/plan.py

26 lines
520 B
Python

from graph.actions import hash_action
def build_action_graph(project):
"""
Converts project targets into executable actions
"""
graph = []
for target, cmd in project["targets"].items():
action = {
"name": target,
"inputs": ["src/**"],
"command": cmd,
"outputs": [f"build/{target}.out"],
"env": project.get("build_env", {})
}
action["hash"] = hash_action(action)
graph.append(action)
return graph