7 ms·
For a task runner I really like just and its Justfile format: https://github.com/casey/just https://github.com/casey/just It is heavily inspired by make but do
by qbasic_forever 4y ago
For a task runner I really like just and its Justfile format: https://github.com/casey/just https://github.com/casey/just It is heavily inspired by make but doesn't focus on the DAG stuff (but does support tasks and dependencies). Crucially it has a much better user experience for listing and documenting tasks--just comment your tasks and it will build a nice list of them in the CLI. It also supports passing CLI parameters to task invocations so you can build simple CLI tools with it too (no need to clutter your repo with little one-off CLI tools written in a myriad of different languages).
If most of your make usage is a bunch of .PHONY nonsense and tricks to make it so developers can run a simple command to get going, check out just. You will find it's not difficult to immediately switch over to its task format.
- kbd 4y agoJust seems neat, but except for the dependencies it's just a way to package multiple shell scripts into one file, no? I've thought about trying it out a few times but can never see its value over scripts in ./bin.
- qbasic_forever 4y agoScripts in bin have no documentation, no easy way to enumerate them, etc. There is definitely a time and a place for bin scripts, especially as things grow in complexity. However the beauty of just is that there's one file (the justfile) that defines all of your project's actions. You don't have to go spelunking into bin to figure out how to tweak a compiler flag, etc. And since just will run anything there's no reason why your complex bin scripts can't just be called from a simple one liner task in a justfile. Could your write a bash script that does stuff like enumerate all the bin scripts, pull out documentation comments, etc.? Absolutely, and people have followed that pattern for a while (see https://github.com/qrush/sub https://github.com/qrush/sub) but it's a bunch of boilerplate to copy between projects. Just pulls out that logic into a simpler config file.
- gurgeous 4y agoSeconded - I love just & Justfile. Such an upgrade after trying to force things into package.json scripts. Chaining commands, optional CLI arguments, comments, simple variables, etc. Very simple and a breath of fresh air.
- niedzielski 4y agoJust looks soooo promising! I don't think I can use it until conventional file target and dependencies are supported though. Right now everything's tasks (phonies) so conventional makefile rules like the following are impractical: tic-tac-toe: tic.o tac.o toe.o cc -o '$@' $^ %.o: %.c; cc -c $^
- qbasic_forever 4y agoYou might find checkexec useful to pair with just, it is basically a tool that only does the file-based dependency part of make: https://github.com/kurtbuilds/checkexec https://github.com/kurtbuilds/checkexec
- davidpfarrell 4y agoFor those looking for a powerful task runners that feel like a makefile, please take a look at Run: https://github.com/TekWizely/run https://github.com/TekWizely/run It's better a managing and invoking tasks and generates help text from comments.
- Groxx 4y agoYeah, that does look fairly promising... turns simple descriptions into usable flags / help comments / etc, which is quite difficult with make. I'll have to poke around this a bit more later, thanks for the link!
- dahfizz 4y agoI don't understand the use case of `just`. It drops every useful feature from `make`. It doesn't look like it has parallelism or the ability to not needlessly re-run tasks. Even if `just` was installed on a standard Linux box, I don't see the benefit of it over a bash script.
- psibi 4y agoI don't think just is trying to be a build system. It's major focus is as a task runner and in that space it does it's job well IMO.
- dahfizz 4y agoAs a task runner, why is it better than a bash script? Being able to run tasks in parallel is like the most fundamental feature I would expect from a task runner. Being able to skip over tasks that don't need to be done is a close second.
- qbasic_forever 4y agoBecause I don't want to have to read and figure out each person's bash idiosyncrasies, bugs, etc. in pile of undocumented scripts to add a new task that runs a new test case. Just gives you a framework to put all your tasks in one file, document them, and find and run them easily. If bash works for you, stick with it. It does not work with large teams and people who aren't deeply experienced in all the footguns of bash in my experience.