cljrs-deps
Purpose
Parses cljrs.edn project configuration files and provides the DepsConfig
type used throughout the runtime to locate git-hosted and local dependencies,
and to discover the optional embedded Rust crate configuration.
Status
Phase 1 (implemented). Config parsing is complete. Integration with the CLI
(cljrs deps fetch/status) is Phase 8 (todo).
File layout
| File | Description |
|---|---|
src/lib.rs |
Public types (DepsConfig, RustConfig, Dependency, Alias, GitDep), find_config_file, load_config |
src/parse.rs |
Walk the cljrs-reader Form tree from a cljrs.edn source into DepsConfig |
Public API
/// Find the nearest `cljrs.edn` by walking up from `start`.
/// A trusted commit signer from `:trusted-signers`: an inline public key
/// (armored PGP or OpenSSH) or a path to a key file resolved relative to
/// `cljrs.edn`.
/// Rust-crate configuration for mixed Rust/Clojure projects.
/// Parsed from the `:rust` key in `cljrs.edn`.
cljrs.edn format
{:paths ["src"]
:deps
{my.lib {:git/url "https://github.com/user/my-lib" :git/sha "abc1234ef"}
;; Native dep with opt-in pinned native code (cljrs-dylib):
my.native.lib {:git/url "https://github.com/user/my-native-lib"
:git/sha "abc1234ef"
:rust/init "my_native_lib::cljrs_init"
:rust/load :dylib}}
;; Optional: embed a Rust crate in this project.
;; :crate is the path (relative to cljrs.edn) to the directory holding Cargo.toml.
;; :init is the fully-qualified Rust path to a fn(registry: &mut Registry) called
;; at startup before any Clojure source is loaded.
:rust {:crate "."
:init "my_project::cljrs_init"}
:aliases
{:dev {:extra-paths ["dev"]}
:test {:extra-paths ["test"]
:extra-deps {test-tools {:git/url "..." :git/sha "..."}}}}}