ninja_parse/
repr.rs

1/*
2 * Copyright 2020 Nikhil Marathe <nsm.nikhil@gmail.com>
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17use std::collections::HashSet;
18
19// Paths are canonicalized and mapped to a cache
20// Rules are interned into indices.
21// This actually needs to come after the variable evaluation pass.
22#[derive(Debug, Default)]
23pub struct Description {
24    // will have things like pools and minimum ninja version and defaults and so on.
25    pub builds: Vec<Build>,
26    pub defaults: Option<HashSet<Vec<u8>>>,
27}
28
29#[derive(Debug)]
30pub enum Action {
31    Phony,
32    Command(String),
33}
34
35#[derive(Debug)]
36pub struct Build {
37    pub action: Action,
38    pub inputs: Vec<Vec<u8>>,
39    pub implicit_inputs: Vec<Vec<u8>>,
40    pub order_inputs: Vec<Vec<u8>>,
41    pub outputs: Vec<Vec<u8>>,
42}