1
//! file that contains the configuration options available
2
/// within Zork++ to configure the way of how it works
3
/// the build process
4
use serde::*;
5

            
6
/// [`BuildAttribute`] - Stores build process specific configuration
7
///
8
/// * `output_dir` - An string representing a relative to the root path
9
///     where the compiler should dump the files generated in the build process.
10
///     If isn't specified, `Zork++` will generate an `./out/...` folder
11
///     by default
12
///
13
/// ```rust
14
/// use zork::config_file::build::{BuildAttribute};
15
///
16
/// const CONFIG_FILE_MOCK: &str = r#"
17
///     #[build]
18
///     output_dir = 'out'
19
///"#;
20
///
21
/// let config: BuildAttribute = toml::from_str(CONFIG_FILE_MOCK)
22
///    .expect("A failure happened parsing the Zork toml file");
23
///
24
/// assert_eq!(config.output_dir, Some("out"));
25
/// ```
26
44
#[derive(Serialize, Deserialize, Debug, PartialEq)]
27
#[serde(deny_unknown_fields)]
28
pub struct BuildAttribute<'a> {
29
    #[serde(borrow)]
30
    pub output_dir: Option<&'a str>,
31
}