parent
5bc1df73af
commit
e0a303c484
2 changed files with 32 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ A preview of the next release can be installed from
|
|||
- Upgrade Clojure to `1.12.0`
|
||||
- Fix [#1722](https://github.com/babashka/babashka/issues/1722): add new clojure 1.12 vars
|
||||
- [#1720](https://github.com/babashka/babashka/issues/1720): Include new clojure 1.12's `clojure.java.process`
|
||||
- [#1719](https://github.com/babashka/babashka/issues/1719): add new clojure 1.12 `clojure.repl.deps` namespace. Only calls with explicit versions are supported.
|
||||
- [#1598](https://github.com/babashka/babashka/issues/1598): use Rosetta on CircleCI to build x64 images
|
||||
- Bump SCI
|
||||
- Bump `fs`
|
||||
|
|
|
|||
31
resources/src/babashka/clojure/repl/deps.clj
Normal file
31
resources/src/babashka/clojure/repl/deps.clj
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
(ns clojure.repl.deps
|
||||
(:require [babashka.deps :as deps]))
|
||||
|
||||
(defn add-libs
|
||||
"Given lib-coords, a map of lib to coord, will resolve all transitive deps for the libs
|
||||
together and add them to the repl classpath, unlike separate calls to add-lib."
|
||||
{:added "1.12"}
|
||||
[lib-coords]
|
||||
(deps/add-deps {:deps lib-coords})
|
||||
nil)
|
||||
|
||||
(defn add-lib
|
||||
"Given a lib that is not yet on the repl classpath, make it available by
|
||||
downloading the library if necessary and adding it to the classloader.
|
||||
Libs already on the classpath are not updated. Requires a valid parent
|
||||
DynamicClassLoader.
|
||||
|
||||
lib - symbol identifying a library, for Maven: groupId/artifactId
|
||||
coord - optional map of location information specific to the procurer,
|
||||
or latest if not supplied
|
||||
|
||||
Returns coll of libs loaded, including transitive (or nil if none).
|
||||
|
||||
For info on libs, coords, and versions, see:
|
||||
https://clojure.org/reference/deps_and_cli"
|
||||
{:added "1.12"}
|
||||
([lib coord]
|
||||
(add-libs {lib coord}))
|
||||
([lib]
|
||||
(throw (ex-info "add-lib without explicit version isn't supported in babashka (yet)" {:lib lib}))))
|
||||
|
||||
Loading…
Reference in a new issue