What are my options for splitting up bb.edn into multiple files?
Hello I'm using Aero to merge different sections of bb.edn (deps, pods, and tasks) to share common configuration between two separate projects. My workflow: 1. Build a merged bb.edn file using Aero 2. Pass it to Babashka via the --config option The merge step adds negligible overhead to execution time but this process requires some kind of alias to the original bb command.
I want to say that they're vaguely in line with the options for splitting up deps.edn into multiple files (not overly-plentiful). Is there something specific you're trying to accomplish?
My task list is starting to get long and I'd like to organize them by splitting them up and composing them into a root bb.edn. I vaguely recall seeing this done somewhere (pr or issue comment maybe?) but can't find it now. I know I can just write namespaces and require those but that's not quite the option I'm trying to recall.
I won't claim any authoritative knowledge, but I'm not aware of a built-in mechanism. I think in theory you could potentially "chain" tasks where the root bb.edn could "namespace" tasks and exec bb with a different cfg file... definitely a workaround/hack.
Bob is right. There's no way to split a tasks file up at the moment
Thanks guys. Guess I'm misremembering something.
There are workarounds but nothing out of the box
e.g. you can use bb --config other-bb.edn tasks
not much, but probably the best I have to offer at the moment
cat bb.edn
{:tasks
{two (apply babashka.process/exec
"bb" "--config" "two.edn" *command-line-args*)}}
cat two.edn
{:tasks
{three (println "hi there")}}
bb two three
hi there
Also, maybe this is the related discussion: <https://github.com/babashka/babashka/discussions/1044>I had a task that looks for another edn file with tasks in it so we could have our own non-commited tasks. it doesn't exactly solve your question, but it rhymes. So it'd work like bb local <local-task-name> --option=on arg1 arg2