Fork me on GitHub

One thing I like about Makefiles is that I can declare dependencies between tasks. This generally speeds things up task running. It also enables a more subtle advantage. When make decides that no actions are needed, no files are touched. This makes it possible to run make with a file watcher that watches the whole directory tree. For example watchexec make or rg --files | entr make. If I were to convert to a bb.edn, and run watchexec bb run make, I would be running updates all the time, because each call to bb run make would recreate files on each call, which would (in turn) trigger a rerun of the make script. So I would be running the make task all the time - not just when something has changed. Then I might as well run watch -n 0.001 bb run make. Which I would prefer not to. Has "add dependency tracking to bb.edn tasks" been discussed before? (I couldn't find any issues).


@U3X7174KS Eeeeh, bb.edn supports dependencies between tasks :)


let me read some docs.


How do I declare which files depend on which? For instance, in this makefile line:

feedback-loops-api-design-how-it-works/index.html: feedback-loops-api-design-how-it-works/
	pandoc -s --toc --from=org+smart -i feedback-loops-api-design-how-it-works/ -o feedback-loops-api-design-how-it-works/index.html
I say that in order to produce feedback-loops-api-design-how-it-works/index.html, one must run
pandoc -s --toc --from=org+smart -i feedback-loops-api-design-how-it-works/ -o feedback-loops-api-design-how-it-works/index.html
, which should be re-run any time
is changed.


You use fs/modified-since for this. I have a blog post about it (will send link later once I'm at kbd)


You've already written a blog post about this, perfect 😁 Thanks!


If I'm reading your post right, you might be aiming for something more flexible. Avoiding huge makefiles that need to be generated (like with cmake). Interesting.


Specifically - my usecase was wanting to run watchexec bb run tests in the Neil repo, which resulted in ./neil being regenerated on each run (bb gen-script), which triggered a rerun.


Right. There's also the fswatcher pod you can use for this btw


more to read up on 😄


(and i do reallly want to use Clojure + EDN for this rather than bash + makefile dependencies)


If I want to process some jpeg files in babashka, what are my options? I don't have javax.imageio


Ideally all I want to do is read them and process them raw as byte buffers.


(ImageIO/read "foo.jpeg") is all I need.


After that, I anyway only operate with the raw bytes.


OK, and this returns a BufferedImage and what are you going to do with that?


If you want bytes you can use fs/read-all-bytes


I'm not reading the raw bytes of the file, I am reading the raw bytes of the pixels from the jpeg. I'm using the bytes from the BufferedImage to find the brightest pixels on the image


Thanks anyway. I can afford to use clj for the project anyway, so I might just stick to clj for this