Fork me on GitHub
#tools-deps
<
2019-08-24
>
dharrigan07:08:55

Is there any chance that "add-libs" branch on tools deps can be rebased from master so that the latest changes on master for the just released version can be brought in? The "add-lib" functionality is really really useful to have (along with the removal of the slf4j-nop library....)

just.sultanov17:08:58

Also waiting for these changes. I had to select a separate library with small edits for my needs. If interested, https://github.com/just-sultanov/clj-deps

seancorfield17:08:34

@U064X3EF3 is usually pretty good about merging master back to the add-lib branch -- esp. once we add-libbers ask for it 🙂

Alex Miller (Clojure team)21:08:40

merged master to it that is

seancorfield00:08:44

You rock! Thank you!

seancorfield00:08:47

@U11EL3P9U @U1EQNSHL4 SHA 148cab8f154711f8495bd632ebdc53a14dff7f09 to save you both going to look it up. I'm updating my dot-clojure repo right now...

just.sultanov10:08:38

In my current project, I need to add libraries to the classpath not only in the REPL at development time. Therefore, I made small changes to the function add-loader-url.

just.sultanov10:08:33

(defn- add-loader-url
  "Add URL string or URL to the highest level DynamicClassLoader or URLClassLoader URL set."
  [url]
  (let [url    (if (string? url) (URL. url) url)
        thread (Thread/currentThread)
        cl     (loop [loader (.getContextClassLoader thread)]
                 (let [parent (.getParent loader)]
                   (if (instance? DynamicClassLoader parent)
                     (recur parent)
                     loader)))]
    (if (instance? DynamicClassLoader cl)
      (.addURL ^DynamicClassLoader cl url)
      (let [loader (.getContextClassLoader thread)
            urls   (into-array URL [url])
            cl     (URLClassLoader. urls loader)]
        (.setContextClassLoader thread cl)))))

dharrigan07:08:18

Thank you 🙂

seancorfield21:08:46

seancorfield/clj-new 0.7.8 -- minor maintenance release: fixes -v / --verbose option (betcha didn't know it was broke, eh?), updates dependencies and pins some new dependencies to avoid weird conflicts in some (Leiningen) templates -- I think that's due to the difference between tools.deps and lein/`boot` in terms of resolving conflicts (gotta love those pesky Jackson libraries!).

😅 4