1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! `foreman`: Rust build script assistant
//!
//! "Don't pick up those environment variables yourself.
//!  Just tell the foreman what to do with the cargo."
//!
//! This crate contains utilities for build scripts to talk to Cargo, abstracting away the input
//! (via special environment variables that Cargo sets) and output (via special patterns that the
//! build script prints to stdout).

#![deny(missing_docs)]

#[macro_use]
extern crate error_chain;
#[macro_use]
extern crate strum_macros;
extern crate strum;
extern crate walkdir;

use std::{env, num, str};

#[macro_use]
mod macros;

error_chain! {
    foreign_links {
        Env(env::VarError)
        /// A required environment variable did not exist or was not valid UTF-8
        ;

        ParseInt(num::ParseIntError)
        /// An environment variable could not be parsed as an integer
        ;

        ParseBool(str::ParseBoolError)
        /// An environment variable could not be parsed as a boolean
        ;

        ParseProfile(strum::ParseError)
        /// An environment variable could not be parsed as a compilation profile
        ;
    }
}

mod types;
pub use types::*;

mod input;
pub use input::*;

mod output;
pub use output::*;