1
//! # mk-lib
2
//!
3
//! `mk-lib` is a library for parsing and running tasks defined in a YAML file.
4
//!
5
//! ## Data formats
6
//!
7
//! The following data formats are supported:
8
//!
9
//! - [YAML], a self-proclaimed human-friendly configuration language that ain't
10
//!   markup language.
11
//!
12
//! [YAML]: https://github.com/dtolnay/serde-yaml
13

            
14
/// Task execution cache helpers
15
pub mod cache;
16

            
17
/// The defaults module contains the default values for the library
18
pub mod defaults;
19

            
20
/// The file module contains the file path handling functions
21
pub mod file;
22

            
23
/// The schema module contains the data structures used to represent the tasks
24
pub mod schema;
25

            
26
/// Shared secret vault helpers used by the CLI and task execution
27
pub mod secrets;
28

            
29
/// The version module contains the version information for the library
30
pub mod version;
31

            
32
/// The macros module contains the custom macros used in the library
33
#[macro_use]
34
pub mod macros;
35

            
36
/// The utils module contains the utility functions used in the library
37
pub mod utils;
38

            
39
/// Label filter parsing and matching used by CLI commands
40
pub mod label_filter;
41

            
42
/// Shared task execution state types
43
pub use schema::{
44
  ActiveTasks,
45
  CompletedTasks,
46
};
47

            
48
/// Generate the JSON Schema for the task configuration file as a pretty-printed JSON string.
49
8
pub fn generate_schema() -> anyhow::Result<String> {
50
8
  let schema = schemars::schema_for!(schema::TaskRoot);
51
8
  Ok(serde_json::to_string_pretty(&schema)?)
52
8
}