start adding build_plan to track the build process for a job

This commit is contained in:
Sebastian Kuzminsky 2025-01-22 14:37:18 -06:00
parent e0e38503f0
commit 233abbe4ff
4 changed files with 61 additions and 4 deletions

30
tools/src/build_plan.rs Normal file
View file

@ -0,0 +1,30 @@
// This is a representation of the recipes/steps that result in a
// desired Output. It's a path from starting points/vitamins to the
// desired Output.
use crate::quantity::*;
// FIXME: this isn't the correct abstraction for Item
#[derive(Debug)]
pub struct Item {
pub name: String,
pub quantity: Quantity,
}
#[derive(Debug)]
pub struct BuildPlan<'a> {
// Keys are the names of Items.
// Values are Items, which are just the name and a Quantity.
pub bom: std::collections::HashMap<String, Item>,
pub repos: &'a crate::repos::Repos,
}
impl<'a> BuildPlan<'a> {
pub fn new(repos: &'a crate::repos::Repos) -> Self {
BuildPlan {
bom: std::collections::HashMap::<String, Item>::new(),
repos,
}
}
}