Fork me on GitHub
#boot
<
2018-02-11
>
drewverlee02:02:59

@seancorfield how do you merge in a dep via the git deps ? i tried (deps :config-paths ["deps.edn"] :quick-merge true) and was hoping my lib in deps.edn would be available in my repl, but its not. Is probably i’m not interpreting quick merge correctly.

seancorfield03:02:35

@drewverlee deps.edn is automatically read from the current directory -- you don't need to specify that.

seancorfield03:02:21

Does clj work for you? i.e., does it start a REPL with your library available.

seancorfield03:02:58

There's no point in using boot-tools-deps unless you've gotten the basics up and running with clj first.

seancorfield04:02:13

@drewverlee here's an example session showing what you should expect with boot-tools-deps

[email protected]:~/clojure/drew$ cat deps.edn
{:deps {clj-http {:mvn/version "RELEASE"}}}
[email protected]:~/clojure/drew$ ls
deps.edn  src
[email protected]:~/clojure/drew$ clj
Clojure 1.9.0
user=> (require '[clj-http.client :as http])
nil
user=>
[email protected]:~/clojure/drew$ boot -d seancorfield/boot-tools-deps deps repl
...
Clojure 1.9.0
...
boot.user=> (require '[clj-http.client :as http])
nil
boot.user=>
both clj and boot-tools-deps read deps.edn by default and in the REPL you can just require it in as expected (note: boot requires src to exist, clj doesn't, so I created an empty src folder)

seancorfield04:02:29

In particular, the REPL only needs the library on the classpath so you do not need to merge things into :dependencies at all (but you may need that later for some Boot tools/tasks to work).

seancorfield04:02:23

Also note, in my example above, there is no build.boot file!

seancorfield04:02:42

If you don't want to specify boot-tools-deps on the command-line like that, you can use a minimal build.boot

(set-env! :dependencies '[[seancorfield/boot-tools-deps "RELEASE"]])

(require '[boot-tools-deps.core :refer [deps]])
and then just say boot deps repl to start a REPL

drewverlee20:02:24

@seancorfield it does. But i must not understand something from reading the docs because my project looks similar but doesn’t work when i run

➜  app git:(master) clj -m bar
Exception in thread "main" java.lang.Exception: namespace 'foo' not found after loading '/foo', compiling:(bar.clj:1:1)
app: https://github.com/drewverlee/bar lib (foo): https://github.com/drewverlee/bar

seancorfield21:02:12

OK, i'll clone that and take a look...

seancorfield21:02:59

The :git/url was incorrect -- should be :git/url "" @drewverlee (when clj didn't even try to access the GitHub repo, I assumed it was missing altogether).

seancorfield21:02:58

Once that's corrected, you get a failure to find foo after loading foo.clj -- that's because you have (ns foo.clj) in in -- should be (ns foo).

seancorfield21:02:43

If you fix that (and update the SHA), you'll get a failure from clj -m bar because your bar.clj has no -main function.

seancorfield21:02:21

Once those three things are all fixed, I think it will work @drewverlee (and then you can start to try boot-tools-deps I guess 🙂 )

drewverlee21:02:32

It was just calling my namespace (ns foo.clj) doh

drewverlee21:02:42

thats what happens when your doing 3 new things at once

drewverlee21:02:11

i’m not sure you need “.git” as it works without and the example doesn’t have it. But everything is working as expected now. Thanks a ton. I think this is a really great step forward towards encouraging ppl to build small libs within there system

seancorfield21:02:05

It didn't work for me without the .git extension, FWIW.

seancorfield21:02:42

Hmm, it works now without the extension. Odd. It didn't clone the repo the first time. I added the .git and it cloned it. I just removed it and it still cloned it 👀

seancorfield22:02:06

OK, glad you have it working -- now you can start to use boot-tools-deps with it 🙂 @drewverlee