This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-07
Channels
- # announcements (6)
- # babashka (17)
- # beginners (72)
- # calva (27)
- # cider (26)
- # circleci (6)
- # clj-kondo (35)
- # cljdoc (3)
- # clojure (22)
- # clojure-australia (2)
- # clojure-dev (45)
- # clojure-france (2)
- # clojure-italy (2)
- # clojurescript (60)
- # conjure (16)
- # cursive (8)
- # datahike (10)
- # datascript (1)
- # datomic (3)
- # emacs (5)
- # fulcro (16)
- # graalvm (4)
- # honeysql (1)
- # joker (10)
- # luminus (3)
- # malli (7)
- # off-topic (28)
- # pathom (4)
- # pedestal (2)
- # polylith (1)
- # re-frame (6)
- # reagent (9)
- # reveal (4)
- # shadow-cljs (48)
- # slack-help (1)
- # tools-deps (30)
- # vim (24)
I am writing a script that is intending to process multiple project’s deps.edn, install the deps, and generate the classpath. Ideally I would to use babashka.deps or babashka.clojure but how would I isolate them? How would I run it in such a way where .cpcache and such are generated according to the project’s respective directory?
@jayzawrotny You mean something like babashka.deps/add-deps
but call it multiple times and get only the resulting classpath for each file?
Now that I think about it I don’t think babashka.deps or babashka.clojure is the best tool for the job on this one. Perhaps I’m better off shelling out to bb --clojure to process those deps as a separate process in their respective project directories?
Calling add-deps does what it says: it only adds deps to the classpath, it doesn't replace the previous classpath. However, you can hack around this by storing the previous classpath and use str/replace to remove it from the next one. This is relying on the impl detail that the classpath is only concatenated currently and there is no de-duplication whatsoever.
yeah, you can shell out using babashka.process
or clojure.java.shell
and set the :dir
argument to start the processes from a different dir
this is one of the reasons I included this, since clojure on Windows is a bit messy with powershell and shelling out and such