Crates.io | make_ultra |
lib.rs | make_ultra |
version | 0.2.4 |
source | src |
created_at | 2022-04-12 22:39:38.918827 |
updated_at | 2022-04-12 22:39:38.918827 |
description | A simple task-runner which tracks changes in files and runs commands based on rules in parallel. |
homepage | |
repository | https://github.com/CoolOppo/make-ultra |
max_upload_size | |
id | 566708 |
size | 48,465 |
Make Ultra is a task runner useful for running certain commands when your files change.
Check out the following rule file (written in TOML):
# saved as makeultra.toml
folders = ["Foo", "Bar"]
[[rule]]
# rules use rusty regex: https://docs.rs/regex/*/regex/#syntax
from = '(?P<name>.*)\.js$'
to = '$name.min.js'
exclude = '\.min\.js$'
# For all commands: $i = input file; $o = output file
command = 'terser $i -o $o'
[[rule]]
from = '(?P<name>.*)\.min\.js$'
to = '$name.min.js.gz'
command = 'zopfli $i'
[[rule]]
from = '(?P<name>.*)\.min\.js$'
to = '$name.min.js.br'
command = 'brotli -f $i'
# Optimize png files in-place, only re-running when you modify them:
[[rule]]
from = '(?P<name>.*\.png)$'
to = '$name'
command = 'optipng -clobber -fix -quiet -strip all $i'
I needed something faster than Grunt and Gulp that had a simpler syntax than Make and tracking of files modified in-place. Make Ultra accomplishes these goals.
exclude
to ensure your rules aren't overly-zealous. Automatically determining appropriate rules is on the roadmap..make_cache
, allowing us to keep track of whether or not to rebuild files and their dependents without relying on filesystem metadata.WalkParallel
to scan directories (the same as fd
and ripgrep
)--dot
option and view the build tree.More is in the works for this project to be worthy of its name, but I don't know if anything can ever beat Make. This also serves as a project for me to learn Rust while accomplishing something that hasn't been done yet in the language (cargo-make isn't language-agnostic and just doesn't have support for wildcards).
This project is not ready for a lot of use cases (e.g. multiple dependencies for a single input file, so you can't link together your .o
files yet). Right now, it actually works great if you are simply running tasks on individual files, but it lacks support for the things that are necessary for more elaborate workloads that will allow you to build larger projects.