(calc-basis merged-edn)
(calc-basis merged-edn {:keys [resolve-args classpath-args] :as argmaps})
Calculates and returns the runtime basis from a merged deps edn map, modifying resolve-deps and make-classpath args as needed.
merged-edn - a merged deps edn map args - an optional map of arguments to constituent steps, keys: :resolve-args - map of args to resolve-deps, with possible keys: :extra-deps :override-deps :default-deps :threads - number of threads to use during deps resolution :trace - flag to record a trace log :classpath-args - map of args to make-classpath-map, with possible keys: :extra-paths :classpath-overrides
Returns the runtime basis, which is the initial deps edn map plus these keys: :libs - lib map, per resolve-deps :classpath - classpath map per make-classpath-map :classpath-roots - vector of paths in classpath order
Calculates and returns the runtime basis from a merged deps edn map, modifying resolve-deps and make-classpath args as needed. merged-edn - a merged deps edn map args - an optional map of arguments to constituent steps, keys: :resolve-args - map of args to resolve-deps, with possible keys: :extra-deps :override-deps :default-deps :threads - number of threads to use during deps resolution :trace - flag to record a trace log :classpath-args - map of args to make-classpath-map, with possible keys: :extra-paths :classpath-overrides Returns the runtime basis, which is the initial deps edn map plus these keys: :libs - lib map, per resolve-deps :classpath - classpath map per make-classpath-map :classpath-roots - vector of paths in classpath order
(combine-aliases edn-map alias-kws)
Find, read, and combine alias maps identified by alias keywords from a deps edn map into a single args map.
Find, read, and combine alias maps identified by alias keywords from a deps edn map into a single args map.
(create-basis {:keys [root user project extra aliases] :as params})
Create a basis from a set of deps sources and a set of aliases. By default, use root, user, and project deps and no argmaps (essentially the same classpath you get by default from the Clojure CLI).
Each dep source value can be :standard, a string path, a deps edn map, or nil. Sources are merged in the order - :root, :user, :project, :extra.
Aliases refer to argmaps in the merged deps that will be supplied to the basis subprocesses (tool, resolve-deps, make-classpath-map).
Options: :root - dep source, default = :standard :user - dep source, default = :standard :project - dep source, default = :standard ("./deps.edn") :extra - dep source, default = nil :aliases - coll of aliases, default = nil
The following subprocess argmap args can be provided: Key Subproc Description :replace-deps tool Replace project deps :replace-paths tool Replace project paths :extra-deps resolve-deps Add additional deps :override-deps resolve-deps Override coord of dep :default-deps resolve-deps Provide coord if missing :extra-paths make-classpath-map Add additional paths :classpath-overrides make-classpath-map Replace lib path in cp
Returns a runtime basis, which is the initial merged deps edn map plus these keys: :basis-config - the create-basis params used :argmap - effective argmap (after resolving and merging argmaps from aliases) :libs - lib map, per resolve-deps :classpath - classpath map per make-classpath-map :classpath-roots - vector of paths in classpath order
Create a basis from a set of deps sources and a set of aliases. By default, use root, user, and project deps and no argmaps (essentially the same classpath you get by default from the Clojure CLI). Each dep source value can be :standard, a string path, a deps edn map, or nil. Sources are merged in the order - :root, :user, :project, :extra. Aliases refer to argmaps in the merged deps that will be supplied to the basis subprocesses (tool, resolve-deps, make-classpath-map). Options: :root - dep source, default = :standard :user - dep source, default = :standard :project - dep source, default = :standard ("./deps.edn") :extra - dep source, default = nil :aliases - coll of aliases, default = nil The following subprocess argmap args can be provided: Key Subproc Description :replace-deps tool Replace project deps :replace-paths tool Replace project paths :extra-deps resolve-deps Add additional deps :override-deps resolve-deps Override coord of dep :default-deps resolve-deps Provide coord if missing :extra-paths make-classpath-map Add additional paths :classpath-overrides make-classpath-map Replace lib path in cp Returns a runtime basis, which is the initial merged deps edn map plus these keys: :basis-config - the create-basis params used :argmap - effective argmap (after resolving and merging argmaps from aliases) :libs - lib map, per resolve-deps :classpath - classpath map per make-classpath-map :classpath-roots - vector of paths in classpath order
(create-edn-maps {:keys [root user project extra]
:as params
:or {root :standard user :standard project :standard}})
Create a set of edn maps from the standard dep sources and return them in a map with keys :root :user :project :extra
Create a set of edn maps from the standard dep sources and return them in a map with keys :root :user :project :extra
(find-edn-maps)
(find-edn-maps project-edn-file)
Finds and returns standard deps edn maps in a map with keys :root-edn, :user-edn, :project-edn If no project-edn is supplied, use the deps.edn in current directory
Finds and returns standard deps edn maps in a map with keys :root-edn, :user-edn, :project-edn If no project-edn is supplied, use the deps.edn in current directory
(find-latest-version {:keys [lib procurer]})
Find versions of lib across all registered procurer types, and return latest version of coord from the first procurer type that has any coords, starting with :mvn, then :git. If none are found, return nil.
Find versions of lib across all registered procurer types, and return latest version of coord from the first procurer type that has any coords, starting with :mvn, then :git. If none are found, return nil.
(join-classpath roots)
Takes a coll of string classpath roots and creates a platform sensitive classpath
Takes a coll of string classpath roots and creates a platform sensitive classpath
(lib-location lib coord deps-config)
Find the file path location of where a lib/coord would be located if procured without actually doing the procuring!
Find the file path location of where a lib/coord would be located if procured without actually doing the procuring!
(make-classpath lib-map paths classpath-args)
Takes a lib map, and a set of explicit paths. Extracts the paths for each chosen lib coordinate, and assembles a classpath string using the system path separator. The classpath-args is a map with keys that can be used to modify the classpath building operation:
:extra-paths - extra classpath paths to add to the classpath :classpath-overrides - a map of lib to path, where path is used instead of the coord's paths
Returns the classpath as a string.
Takes a lib map, and a set of explicit paths. Extracts the paths for each chosen lib coordinate, and assembles a classpath string using the system path separator. The classpath-args is a map with keys that can be used to modify the classpath building operation: :extra-paths - extra classpath paths to add to the classpath :classpath-overrides - a map of lib to path, where path is used instead of the coord's paths Returns the classpath as a string.
(make-classpath-map deps-edn-map lib-map classpath-args)
Takes a merged deps edn map and a lib map. Extracts the paths for each chosen lib coordinate, and assembles a classpath map. The classpath-args is a map with keys that can be used to modify the classpath building operation: :extra-paths - extra classpath paths to add to the classpath :classpath-overrides - a map of lib to path, where path is used instead of the coord's paths
Returns a map: :classpath map of path entry (string) to a map describing where its from, either a :lib-name or :path-key entry. :classpath-roots coll of the classpath keys in classpath order
Takes a merged deps edn map and a lib map. Extracts the paths for each chosen lib coordinate, and assembles a classpath map. The classpath-args is a map with keys that can be used to modify the classpath building operation: :extra-paths - extra classpath paths to add to the classpath :classpath-overrides - a map of lib to path, where path is used instead of the coord's paths Returns a map: :classpath map of path entry (string) to a map describing where its from, either a :lib-name or :path-key entry. :classpath-roots coll of the classpath keys in classpath order
(merge-edns deps-edn-maps)
Merge multiple deps edn maps from left to right into a single deps edn map.
Merge multiple deps edn maps from left to right into a single deps edn map.
(prep-libs! lib-map {:keys [action current log] :or {current false}} config)
Takes a lib map and looks for unprepped libs, optionally prepping them.
Options: :action - what to do when an unprepped lib is found, one of: :prep - if unprepped, prep :force - prep regardless of whether already prepped :error (default) - don't prep, error :current - boolean, default = false. Whether to prep current project :log - print to console based on log level (default, no logging): :info - print only when prepping :debug - :info + print for each lib considered
Takes a lib map and looks for unprepped libs, optionally prepping them. Options: :action - what to do when an unprepped lib is found, one of: :prep - if unprepped, prep :force - prep regardless of whether already prepped :error (default) - don't prep, error :current - boolean, default = false. Whether to prep current project :log - print to console based on log level (default, no logging): :info - print only when prepping :debug - :info + print for each lib considered
(print-tree lib-map)
Print lib-map tree to the console
Print lib-map tree to the console
(resolve-added-libs {:keys [existing add procurer]})
Given an existing map of current libs and a map of libs to add, resolve and download the transitive set of libs that fulfill the added libs and/or detect libs that conflict with the existing libs. Results are printed as edn.
Keys in input map: :existing - map of current lib to coord :add - map of lib to coords to add :procurer - procurer config from basis, if any
Returns a map of: :added - map of added libs to resolved coords (has :paths) :conflict - coll of requested libs that conflict with existing libs
Given an existing map of current libs and a map of libs to add, resolve and download the transitive set of libs that fulfill the added libs and/or detect libs that conflict with the existing libs. Results are printed as edn. Keys in input map: :existing - map of current lib to coord :add - map of lib to coords to add :procurer - procurer config from basis, if any Returns a map of: :added - map of added libs to resolved coords (has :paths) :conflict - coll of requested libs that conflict with existing libs
(resolve-deps deps-map args-map)
Takes a deps configuration map and resolves the transitive dependency graph from the initial set of deps. args-map is a map with several keys (all optional) that can modify the results of the transitive expansion:
:extra-deps - a map from lib to coord of deps to add to the main deps :override-deps - a map from lib to coord of coord to use instead of those in the graph :default-deps - a map from lib to coord of deps to use if no coord specified :trace - boolean. If true, the returned lib map will have metadata with :trace log :threads - long. If provided, sets the number of concurrent download threads
Returns a lib map (map of lib to coordinate chosen).
Takes a deps configuration map and resolves the transitive dependency graph from the initial set of deps. args-map is a map with several keys (all optional) that can modify the results of the transitive expansion: :extra-deps - a map from lib to coord of deps to add to the main deps :override-deps - a map from lib to coord of coord to use instead of those in the graph :default-deps - a map from lib to coord of deps to use if no coord specified :trace - boolean. If true, the returned lib map will have metadata with :trace log :threads - long. If provided, sets the number of concurrent download threads Returns a lib map (map of lib to coordinate chosen).
(root-deps)
Read the root deps.edn resource from the classpath at the path clojure/tools/deps/deps.edn
Read the root deps.edn resource from the classpath at the path clojure/tools/deps/deps.edn
(slurp-deps dep-file)
Read a single deps.edn file from disk and canonicalize symbols, return a deps map. If the file doesn't exist, returns nil.
Read a single deps.edn file from disk and canonicalize symbols, return a deps map. If the file doesn't exist, returns nil.
(tool project-edn tool-args)
Transform project edn for tool by applying tool args (keys = :paths, :deps) and returning an updated project edn.
Transform project edn for tool by applying tool args (keys = :paths, :deps) and returning an updated project edn.
(user-deps-path)
Use the same logic as clj to calculate the location of the user deps.edn. Note that it's possible no file may exist at this location.
Use the same logic as clj to calculate the location of the user deps.edn. Note that it's possible no file may exist at this location.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close