.---. ^
o{__ω__ o{ ^0^ -Let me out!
~~ ( // *|* \xx\) xx`|'
= = xxxx&x ' `
$ cd example
$ tinyrick
running 1 test
test smoketest ... ok
$ tinyrick -h
Usage: tinyrick [options]
Options:
-l, --list list available tasks
-h, --help print usage info
-v, --version print version infoI'm tinyrick (TINYRICK!) and I build Rust projects. With tinyrick, you configure your build in the same normal Rust code as the rest of your project. Or keep picking your nose with make, it's up to you.
Look at my pants! tinyrick! You think my pants are one size fits all? No, of course not! So get the pants that fit you. Get a tinyrick.rs that fits your workflow. Task dependency trees, get em while they're hot! Segfaults, get em while they're not. Smarter, butter, faster, stranger.
Don't shell out, lib out. Your build is more portable that way. tinyricktinyricktinyrick. If you look closely, that last period is actually a micro rick rendered in ASCII; even tinier tinyrick!
https://crates.io/crates/tinyrick
https://docs.rs/tinyrick/latest/tinyrick/
BSD-2-Clause
- ASDF 0.18 (run
asdf reshimafter each Rust application binary installation) - direnv 2
- cargo-cache
- tinyrick_extras
Write some tasks in a tinyrick.rs build configuration script at the top-level directory of your Rust project:
use tinyrick::*;
#[default_task]
fn build() {
deps!(build_release);
}
#[task]
fn build_release() {
deps!(test);
exec!("cargo", "build", "--release");
}
#[task]
fn clippy() {
exec!("cargo", "clippy");
}
// ...
fn main() {
run()
}Now, wire up the tinyrick command line interface by configuring your top-level Cargo.toml:
[package]
name = "arithmancy"
[dependencies]
ctor = { version = "0.6.2", optional = true }
die = "0.2.0"
tinyrick = { version = "0.0.20", optional = true }
tinyrick_macros = { version = "0.0.2", optional = true }
tinyrick_models = { version = "0.0.2", optional = true }
# ...
[features]
letmeout = [
"ctor",
"tinyrick",
"tinyrick_macros",
"tinyrick_models",
]
[[bin]]
name = "tinyrick"
path = "tinyrick.rs"
required-features = ["letmeout"]Launch a terminal session in your project directory. Install and run the tinyrick tool:
$ cargo install tinyrick
$ tinyrickWatch how he behaves... I hope tinyrick is practicing good manners :P
What happens when you run:
tinyrick test?tinyrick clean?tinyrick build?tinyrick -h?tinyrick --list?VERBOSE=1 tinyrick build?
I bet the freakin' moon explodes if you run VERBOSE=1 tinyrick build build build! (Hold onto your pants~)
Where are my pants? Let's break down the code so far:
#[task] fn name() { ... }declares a task namedname.#[default_task] fn name() { ... }declares a task namednameand marks it as the default, when no CLI arguments are passed totinyrick.deps!(requirement)caches a dependency on taskrequirement.exec(command, args sequence)andexec!(command[, arg[, arg[, arg ...]]])run CLI commands.VERBOSE=1enables command string emission during processing.letmeoutis a feature gate, so that neither the tinyrick package, nor your tinyrick binary escape with your Rust package when youtinyrick publish.
Just because the tinyrick library offers several supremely convenient macros for executing shell commands doesn't mean that you should always shell out. No way, man!
Whenever possible, use regular Rust code. There's like a ba-jillion crates of prewritten Rust code, so you might as well use it!
For more details on developing tinyrick itself, see DEVELOPMENT.md.
- Inspired by the excellent mage build system for Go projects
- bb, a build system for (g)awk projects
- beltaloada, a guide to writing build systems for (POSIX) sh
- booty for JS/Node.js/altJS
- cargo custom build scripts, primarily for generating Rust source files from other languages
- cmake for C/C++ projects
- dale builds D projects
- GNU autotools, a build system for Linux C/C++ projects
- Gradle, a build system for JVM projects
- invoke, a Python task runner
- jelly, a JSON task runner
- lair, a lightweight task runner
- lake, a Lua task runner
- Leiningen + lein-exec, a Clojure task runner
- lichen, a sed task runner
- POSIX compliant make, the classic, application language agnostic task runner
- mian, a task runner for (Chicken) Scheme Lisp
- Rake, a task runner for Ruby projects
- Rebar3, a build system for Erlang projects
- rez builds C/C++ projects
- sbt, a build system for Scala projects
- Shake, a task runner for Haskell projects
- yao, a task runner for Common LISP projects
🛸