ninja_files_data2/build/
mod.rs

1mod builder;
2use crate::{FileName, RuleId, Variable, VariableId};
3pub use builder::*;
4use std::collections::{BTreeMap, BTreeSet};
5
6#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
7pub struct BuildOutput {
8    pub explicits: BTreeSet<FileName>,
9    pub implicits: BTreeSet<FileName>,
10}
11
12impl BuildOutput {
13    pub fn default() -> Self {
14        BuildOutput {
15            explicits: BTreeSet::new(),
16            implicits: BTreeSet::new(),
17        }
18    }
19}
20
21#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
22pub struct Build {
23    pub rule: RuleId,
24    pub explicits: BTreeSet<FileName>,
25    pub implicits: BTreeSet<FileName>,
26    pub order: BTreeSet<FileName>,
27    pub dyndep: Option<FileName>,
28    pub shadow: BTreeMap<VariableId, Variable>,
29}
30
31impl From<FileName> for BuildOutput {
32    fn from(f: FileName) -> Self {
33        let mut explicits: BTreeSet<FileName> = BTreeSet::new();
34        explicits.insert(f);
35        Self {
36            explicits,
37            implicits: BTreeSet::new(),
38        }
39    }
40}