build-pretty 1.0.0

Pretty to your custom Build Script(build.sh) log displaying!
Documentation

githubโ€‚crates-ioโ€‚docs-rs

build-pretty

This lib crate is one of workarround solution for log displaying of Build Scripts issue such as rust-lang/cargo#985.

Usage

  1. Add build-pretty dependency in [build-dependencies] of your project's Cargo.toml
[package]
...
build = "build.rs"
...
[build-dependencies]
build-pretty = "*"
  1. Write your build.rs with build-pretty:
use build_pretty::{
 build_pretty,
 CommandBuilder
};

fn main()
{
 build_pretty!()
  .enque_command("Drink a cup of tea", CommandBuilder::new_with_arg("echo", "๐Ÿต Green!\nโ˜• Black!\n๐Ÿง‹ Bubbles!").into())
  .enque_command("Eat a hotdog", CommandBuilder::new_with_arg("echo", "๐ŸŒญ Hotdog!\nโ™จ๏ธ Hot?\n๐Ÿ• Dog!\n๐ŸŒถ๏ธ Hot?\n๐Ÿถ Dog?").into())
  .enque_command("ls -l -a", CommandBuilder::new_with_args("ls", &["-l", "-a"]).into())
  .enque_fn("Ofcourse Fn can be used", Box::new(|output|{ *output = "brabrabra\nmewmewmew\nnekonyankonyanko๐Ÿพ".to_string(); Ok(()) }))
  .enque_command("Sleep", CommandBuilder::new_with_arg("echo", "๐Ÿ˜ด I'm sleee....\n๐Ÿ’ค...\n๐Ÿ›Œ....pyyyyy....").into());
}

and then:

Examples:

Features:

  • std::process::Command runner with STDOUT/STRERR log capturing!
  • Fn runner with String output capturing!
  • cargo_warning_ln! macro, it's also to Build Script version println!.
  • runtime message customize feature. on/off, change message detail as your like with easy template keywords.
  • i18n subsystem support. (using rust-i18n)
    • Currently supported: en ja
    • Welcome your additional language support PR!๐Ÿ˜†

LICENSE

Author