-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtinyrick.rs
85 lines (71 loc) · 1.4 KB
/
tinyrick.rs
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
83
84
85
//! Build configuration
extern crate tinyrick;
extern crate tinyrick_extras;
/// Generate documentation
fn doc() {
tinyrick_extras::build();
}
/// Security audit
fn audit() {
tinyrick::exec!("cargo", &["audit"]);
}
/// Run clippy
fn clippy() {
tinyrick_extras::clippy();
}
/// Run rustfmt
fn rustfmt() {
tinyrick_extras::rustfmt();
}
/// Run unmake
fn unmake() {
tinyrick::exec!("unmake", &["."]);
tinyrick::exec!("unmake", &["-n", "."]);
}
/// Validate documentation and run linters
fn lint() {
tinyrick::deps(doc);
tinyrick::deps(clippy);
tinyrick::deps(rustfmt);
tinyrick::deps(unmake);
}
/// Doc, lint, and run tests
fn test() {
tinyrick::deps(lint);
tinyrick_extras::unit_test();
assert!(tinyrick::exec_mut!("tinyrick", &["build", "uninstall"])
.current_dir("example")
.env("VERBOSE", "1")
.status()
.unwrap()
.success());
}
/// Build: Doc, lint, test, and compile
fn build() {
tinyrick::deps(test);
tinyrick_extras::build();
}
/// Publish to crate repository
fn publish() {
tinyrick_extras::publish();
}
/// Clean workspaces
fn clean() {
tinyrick_extras::clean_cargo();
}
/// CLI entrypoint
fn main() {
tinyrick::phony!(clean);
tinyrick::wubba_lubba_dub_dub!(
build;
doc,
audit,
clippy,
rustfmt,
unmake,
lint,
test,
publish,
clean
);
}