This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-16
Channels
- # adventofcode (24)
- # announcements (3)
- # aws (3)
- # babashka (16)
- # beginners (88)
- # biff (5)
- # calva (27)
- # cider (15)
- # cljs-dev (70)
- # clojure (87)
- # clojure-austin (3)
- # clojure-belgium (6)
- # clojure-europe (59)
- # clojure-nl (1)
- # clojure-norway (14)
- # clojure-uk (3)
- # clojurescript (37)
- # data-science (2)
- # datalevin (40)
- # datomic (1)
- # emacs (23)
- # events (2)
- # graalvm (13)
- # graphql (7)
- # gratitude (1)
- # holy-lambda (193)
- # inf-clojure (15)
- # lsp (27)
- # malli (9)
- # off-topic (20)
- # polylith (6)
- # reitit (29)
- # releases (2)
- # scittle (13)
- # shadow-cljs (51)
- # transit (15)
- # xtdb (29)
Hi, what would be the canonical way to request an nrepl-server on a random port? bb nrepl-server 0
or bb nrepl-server :0
? the first format is suggested by the bb book, though the second also provides some hint that we are referring to a port and not to an interface address; just wanted to ensure that the latter is also a supported format (it seems to work), thanks
There isn't an explicit API for this, although it's been asked before. But you can do it programmatically with (babashka.deps/add-deps (edn/parse-string (slurp "deps.edn")) {:aliases [:foo]})
You can do this by placing those coercions on the namespace metadata and then exec
functions from that namespace
The :task
code doesn't have a namespace. So I think you're saying I would need an external bb script that the task would call to parse the arguments?
Can you tell me how you would use those coercions in tasks? Maybe it's best to talk from there
I'm back working on test running, and planning to try using cognitect/cljs test runner across the board. I need a separate task for each test environment, where each needs the arguments parsed to pass into cognitect.test-runner.api/test
.
:task (exec 'cognitect.test-runner.api/test)
:org.babashka/cli {:coerce {:dirs []
:nses [:symbol]
:patterns []
:vars [:symbol]
:includes [:keyword]
:excludes [:keyword]
:only [:symbols]}}
Actually... maybe I don't need that at all except for BB test. I guess for other enviroments I would be using (clojure ...)
. Can I just pass the arguments unchanged to that?
I've made a little wrapper like this, which is used for running clojure tests for babashka CLI itself: https://github.com/babashka/cli/blob/main/test/babashka/test_runner.clj
the deps.edn config: https://github.com/babashka/cli/blob/30f9201dafe60f157b6c9de2ec6d68b2f3ef2cac/deps.edn#L6-L13
or you can do:
clojure -X:test :vars '[foo.bar/baz]'
which is the standard deps.edn syntax