Fork me on GitHub
Mukund Z11:05:47

@borkdude Making an uberjar solved the problem! Another question: I use emacs with CIDER to connect to the remote machine's bb nREPL server. I fire up the nREPL conventionally like bb nrepl-server 1667 and would like to continue with my development (with the medley dependency) loaded into the REPL session. It seems to me that it is not so straight forward to load the jar in the REPL. Hot-loading *.clj files where the medley dependency is used in my emacs cider session still throws the missing dependency issue. Is there a way to make the nREPL server to load an uberjar? As per my limited knowledge, one can connect to a running clojure application's nREPL server (which I honestly have not reached yet to do 😄).


@mukundzare Yes, you can do that :)

(babashka.classpath/add-classpath "deps/medley.jar")

👀 1
Mukund Z12:05:10

This seems to not work for me somehow. I made the repl connection by using the --classpath however.


Define "to not work"


The jar file has to live on the remote machine of course

Mukund Z12:05:48


Mukund Z12:05:02

let me paste the folder structure

Mukund Z12:05:13

last_restart.clj is where I define the classpath using add-classpath


if you start bb from the directory where bb.edn resides, you should be able to do (babashka.classpath/add-classpath "deps/medley.jar")


gotta go, be back later.

Mukund Z13:05:01

that worked!

Mukund Z13:05:31

either I could use --classpath and call bb from anywhere OR call bb from the place where bb.edn exists

Mukund Z13:05:52

thanks again!

Mukund Z11:05:54

Does this mean that I can add this dynamic classpath to let's say my main.clj and then add the (require '[medley.core :as m] statement form and don't bother with a uberjar?


yeah, I guess so :)

Mukund Z11:05:10


Mukund Z11:05:14

let me try that


You can see the running site here:

❤️ 4
🎉 1
wow 1

@borkdude: do you think we can add some parameters to bb tasks command ? I would like to add --format parameter to list tasks in different formats (simple and edn). the end goal is to improve this part:

;; Type bb tasks to see all tasks
;; Type bb <task-name> or bb run <task-name> to run a task
{:min-bb-version "0.7.4"
 :tasks {:requires ([clojure.string :as str])
         app {:doc "Without arguments, prints tasks in app - with arguments, invokes task in app dir"
              :task (if (empty? *command-line-args*)
                      (shell {:dir "projects/app"} "bb tasks")
                      (shell {:dir "projects/app"}
                             (str "bb run " (str/join " " *command-line-args*))))}}} 
so I can list all tasks in a directory and print them with the prefix.


also, it would be cool if I could intercept task execution and choose if I want to run the task or do something else. Trying to figure out how can I call tasks in different directories from a central place


@U011NGC5FFY The bb.edn is already EDN so why would you need EDN output? :)


yeah, I guess I don't 🙂


is there a way to register tasks via a function call. Wondering if I can read tasks from a bb edn and register them via a function


Currently there is not a way to dynamically create tasks


yes, looks very much related


or a possible solution for my use case