This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-03
Channels
- # announcements (17)
- # asami (17)
- # babashka (20)
- # beginners (110)
- # calva (1)
- # cherry (3)
- # cider (1)
- # clj-kondo (21)
- # clj-on-windows (1)
- # cljsrn (5)
- # clojure (142)
- # clojure-austin (1)
- # clojure-europe (72)
- # clojure-france (28)
- # clojure-hungary (2)
- # clojure-nl (2)
- # clojure-norway (38)
- # clojure-poland (2)
- # clojure-uk (3)
- # clojurescript (4)
- # cursive (33)
- # data-science (3)
- # datahike (5)
- # datomic (1)
- # emacs (27)
- # events (3)
- # fulcro (15)
- # graalvm (4)
- # gratitude (2)
- # honeysql (7)
- # humbleui (8)
- # introduce-yourself (11)
- # jobs-discuss (9)
- # lambdaisland (3)
- # lsp (18)
- # malli (62)
- # music (1)
- # nbb (3)
- # off-topic (10)
- # pathom (3)
- # pedestal (6)
- # polylith (5)
- # re-frame (7)
- # releases (2)
- # shadow-cljs (33)
- # sql (1)
- # test-check (23)
- # vim (20)
- # xtdb (9)
struggling with my searching, I have a bb.edn with some tasks I want to create a tasks.clj and put some of the code in functions, do i need a deps.edn for this or can i just require the file in some way ? or how best to seperate the code so bb.edn does not end up massive
@oliver.marks The way to do this is:
• Create a directory where you put the code, e.g. bb/tasks.clj
• Add :paths ["bb"]
to your bb.edn
ah I have it in the root currently, I will give that a try thanks for the awesome support 🙂
If you want to have it in the root, it can stay there. Then add :paths ["."]
to bb.edn to add the root dir to the classpath
Is there a way to see which babashka task is running?
thanks. we got a big chain of dependent tasks running, and I’d like to see the task name printed. is there a builtin verbose option for this?
There is an example in the book:
{:tasks
{:init (def log (Object.))
:enter (locking log
(println (str (:name (current-task))
":")
(java.util.Date.)))
a (Thread/sleep 5000)
b (Thread/sleep 5000)
c {:depends [a b]}
d {:task (time (run 'c))}}}
oh, thank you!
Ah, I see it documented here now: https://book.babashka.org/#_run
what I settled on:
:init (def log (Object.))
:enter (locking log (println "[bb tasks] Started:" (:name (current-task))))
:leave (locking log (println "[bb tasks] Finished:" (:name (current-task))))
Im wondering why we need this locking
part?
i assumed it was to prevent printers from parallel tasks from crossing streams