This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-17
Channels
- # announcements (2)
- # babashka (52)
- # beginners (10)
- # calva (9)
- # cider (2)
- # clj-kondo (7)
- # clojure (63)
- # clojure-europe (26)
- # clojuredesign-podcast (5)
- # clojurescript (13)
- # datalog (2)
- # datomic (6)
- # defnpodcast (1)
- # fulcro (46)
- # incanter (4)
- # integrant (5)
- # jobs-discuss (12)
- # kaocha (1)
- # lsp (31)
- # malli (10)
- # meander (1)
- # off-topic (6)
- # podcasts (1)
- # polylith (20)
- # rewrite-clj (6)
- # shadow-cljs (23)
- # tools-deps (9)
- # xtdb (13)
- # yada (10)
Made a video showing bb tasks
as it is currently. I'd love to have your feedback!
https://youtu.be/b-XwAIM0bV0
@borkdude if task b
depends on a
and task c
depends on a
, but task a
should have different params from b
and c
how I can implement such behaviour ?
I mean using :depends
section?
solved: I made a as a function and call a from b and c with different params
@mike1452 Correct, you should just use a function, since :depends
cannot decide if a task has already been run if you use parameters
How I can print :doc section inside task for this task or another task? Can I access to it via meta?
There isn't anything around this (yet). You could just parse the EDN file yourself and look up the docstring perhaps.
thanks
Since bb now supports rewrite-clj, rewrite-edn is also compatible with babashka: https://github.com/babashka/babashka/issues/793
(cp/add-classpath classpath)
(require '[datomic.api :as d])
dynamically adds datomic pass to classpaht, but errs with: ----- Error --------------------------------------------------------------------
Type: java.lang.Exception
Message: Could not find namespace: datomic.api.
Location: 15:1@i babashka can only run clojure from source (`.clj`, etc.) and I guess the datomic.api namespace is AOT-ed
There was a PR which tried to add the datomic pro client as a built-in library to bb, but it stalled: https://github.com/babashka/babashka/pull/505
nice video. In your -java-files
example, is it that a depency’s return value is bound to that name in the task context?
looks like it, that’s really nice
test1 {:task ["echo hello"]}
test2 {:task '("echo hello")}
would you expect the second to fail? is '()
not a thing in edn?
@grazfather correct. and the second thing currently works but this is because '
is allowed in EDN, it's just parsed as a separate token. In a second pass it's parsed as normal code. If you want a list you can also use (list 1 2 3)
yep I switched to list, I just got a weird error about my tasks map not being valid
yep vector works as well
i wanted to test a simple task that only returns something and ’(..) failed
bb can’t even parse the tasks
Ah I see why it failed. In EDN {:foo 'bar}
is parsed as {:foo ' bar}
which is an invalid map :)
yeah I was wondering, but I didn’t know how to get the intermediate representation
yeah there are many ways around it i just wanted to confirm it was my problem and not bbs
You should have used the coffee example for your parallel demo 😉
Maybe I will do another video about parallel, since I also forgot to demo the parallel dev task I had :/. Thanks for reminding me, I'll also include the coffee
yeah it’s pretty powerful. You don’t need to include the coffee, I meant it as an example since it would clearly show the time saved, your demo in this video unfortunately didn’t save a ton
@grazfather btw, about the quote thing: you can also write (quote (1 2 3))
, this is what '(1 2 3)
expands into
yeah I know how the reader macros work pretty well, I think, I just don’t know as well how they work in edn format
since it’s less clear when the eval is, i think
same idea about reader macros?
strange that #{}
does though
yes exactly
it had me wondering because of the parallel tasks thing from before
right, but why do some reader macros work and not others?
¯\(ツ)/¯
Can't load libraries in task.
-env {:requires ([babashka.deps :as deps])
:task (do
(require '[babashka.deps :as deps])
(deps/add-deps '{:deps {cprop/cprop {:mvn/version "0.1.16"}}})
(require '[cprop.core :refer [load-config]])
(load-config))}
16: (def -env (do (require ' [babashka.deps :as deps]) (deps/add-deps ' {:deps {cprop/cprop {:mvn/version "0.1.16"}}}) (require ' [cprop.core :refer [load-config]]) (load-config))) -env
^--- Could not resolve symbol: load-config
What I'm doing wrong?
{:deps {cprop/cprop {:mvn/version "0.1.16"}}
:tasks {-env {:requires ([cprop.core :refer [load-config]])
:task (load-config)}}}
ah! thanks!