Port of https://github.com/clojure/brew-install/blob/1.11.1/src/main/resources/clojure/install/clojure in Clojure
Port of https://github.com/clojure/brew-install/blob/1.11.1/src/main/resources/clojure/install/clojure in Clojure
(*aux-process-fn* {:keys [cmd out]})
Invokes java
with arguments to calculate classpath, etc. May be
replaced by rebinding this dynamic var.
Called with a map of:
:cmd
: a vector of strings:out
: if set to :string
, :out
key in result must contains stdoutReturns a map of:
:exit
, the exit code of the process:out
, the string of stdout, if the input :out
was set to :string
Invokes `java` with arguments to calculate classpath, etc. May be replaced by rebinding this dynamic var. Called with a map of: - `:cmd`: a vector of strings - `:out`: if set to `:string`, `:out` key in result must contains stdout Returns a map of: - `:exit`, the exit code of the process - `:out`, the string of stdout, if the input `:out` was set to `:string`
(*clojure-process-fn* {:keys [cmd]})
Invokes java
with arguments to clojure.main
to start Clojure. May
be replaced by rebinding this dynamic var.
Called with a map of:
:cmd
: a vector of stringsMust return a map of :exit
, the exit code of the process.
Invokes `java` with arguments to `clojure.main` to start Clojure. May be replaced by rebinding this dynamic var. Called with a map of: - `:cmd`: a vector of strings Must return a map of `:exit`, the exit code of the process.
Can be dynamically rebound to customise the download of the Clojure tools. Should be bound to a function accepting a map with:
:url
: The URL to download, as a string:dest
: The path to the file to download it to, as a string:proxy-opts
: a map as returned by get-proxy-info
:clj-jvm-opts
: a vector of JVM opts (as passed on the command line).Should return true
if the download was successful, or false if not.
Can be dynamically rebound to customise the download of the Clojure tools. Should be bound to a function accepting a map with: - `:url`: The URL to download, as a string - `:dest`: The path to the file to download it to, as a string - `:proxy-opts`: a map as returned by `get-proxy-info` - `:clj-jvm-opts`: a vector of JVM opts (as passed on the command line). Should return `true` if the download was successful, or false if not.
Directory in which deps.clj should be executed.
Directory in which deps.clj should be executed.
(*exit-fn* {:keys [exit message]})
Function that is called on exit with :exit
code and :message
, an exceptional message when exit is non-zero
Function that is called on exit with `:exit` code and `:message`, an exceptional message when exit is non-zero
(*getenv-fn* env)
Get ENV'ironment variable, typically used for getting CLJ_CONFIG
, etc.
Get ENV'ironment variable, typically used for getting `CLJ_CONFIG`, etc.
(-main & command-line-args)
See help-text
.
In addition
the values of the CLJ_JVM_OPTS
and JAVA_OPTIONS
environment
variables are passed to the java subprocess as command line options
when downloading dependencies and running any other commands
respectively.
if the clojure tools jar cannot be located and the clojure tools
archive is not found, an attempt is made to download the archive
from the official site and extract its contents locally. The archive
is downloaded from this process directly, unless the CLJ_JVM_OPTS
env variable is set and a succesful attempt is made to download the
archive by invoking a java subprocess passing the env variable value
as command line options.
See `help-text`. In addition - the values of the `CLJ_JVM_OPTS` and `JAVA_OPTIONS` environment variables are passed to the java subprocess as command line options when downloading dependencies and running any other commands respectively. - if the clojure tools jar cannot be located and the clojure tools archive is not found, an attempt is made to download the archive from the official site and extract its contents locally. The archive is downloaded from this process directly, unless the `CLJ_JVM_OPTS` env variable is set and a succesful attempt is made to download the archive by invoking a java subprocess passing the env variable value as command line options.
(clojure-tools-download-direct! {:keys [url dest]})
Downloads from :url
to :dest
file returning true on success.
Downloads from `:url` to `:dest` file returning true on success.
(clojure-tools-download-java! {:keys [url dest proxy-opts clj-jvm-opts]})
Downloads :url
zip file to :dest
by invoking java
with
:proxy
options on a .java
program file, and returns true on
success. Requires Java 11+ (JEP 330).
Downloads `:url` zip file to `:dest` by invoking `java` with `:proxy` options on a `.java` program file, and returns true on success. Requires Java 11+ (JEP 330).
(clojure-tools-install! {:keys [out-dir debug proxy-opts clj-jvm-opts]})
Installs clojure tools archive by downloading it in :out-dir
, if not already there,
and extracting in-place.
If *clojure-tools-download-fn*
is set, it will be called for
download the tools archive. This function should return a truthy
value to indicate a successful download.
The download is attempted directly from this process, unless
:clj-jvm-opts
is set, in which case a java subprocess
is created to download the archive passing in its value as command
line options.
It calls *exit-fn*
if it cannot download the archive, with
instructions how to manually download it.
Installs clojure tools archive by downloading it in `:out-dir`, if not already there, and extracting in-place. If `*clojure-tools-download-fn*` is set, it will be called for download the tools archive. This function should return a truthy value to indicate a successful download. The download is attempted directly from this process, unless `:clj-jvm-opts` is set, in which case a java subprocess is created to download the archive passing in its value as command line options. It calls `*exit-fn*` if it cannot download the archive, with instructions how to manually download it.
The current version of deps.clj
The current version of deps.clj
(get-basis-file {:keys [cache-dir checksum]})
Returns path to basis file. Required options:
cache-dir
as returned by get-cache-dir
checksum
as returned by get-check-sum
Returns path to basis file. Required options: * - `cache-dir` as returned by `get-cache-dir` * - `checksum` as returned by `get-check-sum`
(get-cache-dir {:keys [deps-edn config-dir]})
Returns cache dir (.cpcache
) from either local dir, if deps-edn
exists, or the user cache dir.
Returns cache dir (`.cpcache`) from either local dir, if `deps-edn` exists, or the user cache dir.
(get-checksum {:keys [cli-opts config-paths]})
Returns checksum based on cli-opts (as returned by parse-cli-opts
)
and config-paths (as returned by get-config-paths
)
Returns checksum based on cli-opts (as returned by `parse-cli-opts`) and config-paths (as returned by `get-config-paths`)
(get-config-dir)
Retrieves configuration directory.
First tries CLJ_CONFIG
env var, then $XDG_CONFIG_HOME/clojure
, then ~/.clojure.
Retrieves configuration directory. First tries `CLJ_CONFIG` env var, then `$XDG_CONFIG_HOME/clojure`, then ~/.clojure.
(get-config-paths {:keys [cli-opts deps-edn config-dir install-dir]})
Returns vec of configuration paths, i.e. deps.edn from:
:install-dir
as obtained thrhough get-install-dir
:config-dir
as obtained through get-config-dir
:deps-edn
as obtained through get-local-deps-edn
Returns vec of configuration paths, i.e. deps.edn from: - `:install-dir` as obtained thrhough `get-install-dir` - `:config-dir` as obtained through `get-config-dir` - `:deps-edn` as obtained through `get-local-deps-edn`
(get-install-dir)
Retrieves the install directory where tools jar is located (after download). Defaults to ~/.deps.clj/<version>/ClojureTools.
Retrieves the install directory where tools jar is located (after download). Defaults to ~/.deps.clj/<version>/ClojureTools.
(get-local-deps-edn {:keys [cli-opts]})
Returns the path of the deps.edn
file (as string) in the current directory or as set by -Sdeps-file
.
Required options:
:cli-opts
: command line options as parsed by parse-opts
Returns the path of the `deps.edn` file (as string) in the current directory or as set by `-Sdeps-file`. Required options: * `:cli-opts`: command line options as parsed by `parse-opts`
(get-proxy-info)
Returns a map with proxy information parsed from env vars. The map will contain :http-proxy and :https-proxy entries if the relevant env vars are set and parsed correctly. The value for each is a map with :host and :port entries.
Returns a map with proxy information parsed from env vars. The map will contain :http-proxy and :https-proxy entries if the relevant env vars are set and parsed correctly. The value for each is a map with :host and :port entries.
(parse-cli-opts args)
Parses the command line options.
Parses the command line options.
(proxy-jvm-opts {:keys [http-proxy https-proxy]})
Returns a vector containing the JVM system property arguments to be passed to a new process
to set its proxy system properties.
proxy-info parameter is as returned from get-proxy-info.
Returns a vector containing the JVM system property arguments to be passed to a new process to set its proxy system properties. proxy-info parameter is as returned from `get-proxy-info.`
(set-proxy-system-props! {:keys [http-proxy https-proxy]})
Sets the proxy system properties in the current JVM.
proxy-info parameter is as returned from get-proxy-info.
Sets the proxy system properties in the current JVM. proxy-info parameter is as returned from `get-proxy-info.`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close