extern crate tinyrick;
extern crate tinyrick_extras;
use std::path;
fn doc() {
tinyrick_extras::build();
}
fn audit() {
tinyrick::exec!("cargo", &["audit"]);
}
fn clippy() {
tinyrick_extras::clippy();
}
fn rustfmt() {
tinyrick_extras::rustfmt();
}
fn unmake() {
tinyrick::exec!("unmake", &["makefile"]);
}
fn install() {
tinyrick::exec!("cargo", &["install", "--force", "--path", "."]);
}
fn uninstall() {
tinyrick::exec!("cargo", &["uninstall"]);
}
fn lint() {
tinyrick::deps(install);
tinyrick::deps(doc);
tinyrick::deps(clippy);
tinyrick::deps(rustfmt);
tinyrick::deps(unmake);
}
fn test() {
tinyrick_extras::unit_test();
}
fn build() {
tinyrick::deps(lint);
tinyrick::deps(test);
tinyrick_extras::build();
}
fn banner() -> String {
format!("{}-{}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"))
}
fn archive() {
let b: &str = &banner();
let archive_basename: &str = &format!("{}.zip", b);
let archive_path: &path::Path = path::Path::new(archive_basename);
let archive_str: &str = &archive_path.display().to_string();
let binary_artifacts_dir_str: &str =
&path::Path::new(".crit").join("bin").display().to_string();
assert!(tinyrick::exec_mut!("zip", &["-r", archive_str, b])
.current_dir(binary_artifacts_dir_str)
.status()
.unwrap()
.success());
}
fn port() {
tinyrick_extras::crit(vec!["-b".to_string(), banner()]);
tinyrick::deps(archive);
}
fn publish() {
tinyrick_extras::publish();
}
fn clean_ports() {
assert!(tinyrick::exec_mut!("crit", &["-c"])
.status()
.unwrap()
.success());
}
fn clean() {
tinyrick_extras::clean_cargo();
tinyrick::deps(clean_ports);
}
fn main() {
tinyrick::phony!(clean);
tinyrick::wubba_lubba_dub_dub!(
build;
doc,
install,
uninstall,
audit,
clippy,
rustfmt,
unmake,
lint,
test,
archive,
port,
publish,
clean_ports,
clean
);
}