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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
use time;
use dev_prefix::*;
pub mod prefix;
pub mod types;
pub mod utils;
#[macro_use]
pub mod load;
pub mod save;
pub mod link;
pub mod locs;
pub mod name;
pub mod security;
mod serialize;
#[cfg(test)]
pub mod tests;
pub use core::load::load_toml;
pub use core::utils::find_repo;
pub use core::types::{Project, Artifact, Artifacts, ArtType, Done, Loc, ArtName, ArtNameRc,
ArtNames, Settings, LoadFromStr, PARENT_PATH, LocData, ArtifactData};
#[cfg(test)]
use super::init_logger;
#[cfg(test)]
pub fn init_logger_test() {
match init_logger(false, 3, false) {
Ok(_) => {}
Err(_) => {}
}
}
pub fn process_project_text(settings: Settings,
project_text: &types::ProjectText)
-> Result<Project> {
let mut project = Project::default();
project.settings = settings;
project.extend_text(project_text)?;
load::process_project(&mut project)?;
project.origin = project_text.origin.clone();
Ok(project)
}
pub fn load_path(path: &Path) -> Result<Project> {
let start = time::get_time();
info!("loading path: {}", path.to_string_lossy().as_ref());
let project = load::load_project(path)?;
let total = time::get_time() - start;
info!("Done loading: {} artifacts loaded successfullly in {:.3} seconds",
project.artifacts.len(),
total.num_milliseconds() as f64 * 1e-3);
Ok(project)
}