(copy-source-files source-paths target-path)(copy-source-files source-paths target-path target-suffix)Maven repositories used to resolve dependencies when none are supplied.
Maven repositories used to resolve dependencies when none are supplied.
(inline-deps {:keys [dependencies source-paths project-prefix target-path
repositories pname pversion skip-repackage-java-classes
prefix-exclusions unresolved-tree overrides expositions
watermark]
:or {target-path "target"
repositories default-repositories
pname "mranderson"
pversion "0.0.0"
skip-repackage-java-classes false
unresolved-tree false
watermark :mranderson/inlined}})Inline and shadow :dependencies so they cannot interfere with the
dependencies of downstream consumers.
This is the Leiningen-free counterpart of the leiningen.inline-deps plugin
task: it takes a plain options map instead of a Leiningen project map, which
makes it usable from a tools.build build script:
(require '[mranderson.core :as mranderson])
(mranderson/inline-deps
{:project-prefix "com.example.inlined"
:source-paths ["src"]
:dependencies '[[org.clojure/tools.namespace "1.5.1"]]})
or directly as a Clojure CLI tool function (clojure -T:mranderson inline-deps).
The project's own :source-paths and the resolved dependency sources are
copied into <target-path>/srcdeps, with the dependency namespaces (and
references to them, including those in the project's own sources) rewritten
under :project-prefix.
Options:
:dependencies (required) vector of [lib version & kvs] coordinates to
inline. Every entry is treated as an inline dep, so there
is no need to attach ^:inline-dep meta yourself.:source-paths (required) the project's own source directories to copy
into srcdeps and rewrite.:project-prefix namespace/path prefix for the shadowed deps. Defaults to a
random mranderson<hex> prefix; set a stable value for
reproducible output.:target-path build target directory. Defaults to "target"; output is
written to <target-path>/srcdeps.:repositories Maven repositories used for resolution. Defaults to Maven
Central and Clojars (see default-repositories).:pname project name, used when repackaging bundled Java classes.
Defaults to "mranderson".:pversion project version, used when repackaging bundled Java
classes. Defaults to "0.0.0".:skip-repackage-java-classes skip jarjar repackaging of bundled .class
files. Defaults to false.:prefix-exclusions seq of prefixes to leave untouched when rewriting Java
imports.:unresolved-tree use unresolved-tree mode (deeply nested isolation).
Defaults to false.:overrides overrides for unresolved-tree mode.:expositions transitive deps to expose to the project's sources in
unresolved-tree mode.:watermark meta key marking inlined namespaces. Defaults to
:mranderson/inlined.Returns the resolved project prefix (handy when it was generated).
Inline and shadow `:dependencies` so they cannot interfere with the
dependencies of downstream consumers.
This is the Leiningen-free counterpart of the `leiningen.inline-deps` plugin
task: it takes a plain options map instead of a Leiningen project map, which
makes it usable from a `tools.build` build script:
(require '[mranderson.core :as mranderson])
(mranderson/inline-deps
{:project-prefix "com.example.inlined"
:source-paths ["src"]
:dependencies '[[org.clojure/tools.namespace "1.5.1"]]})
or directly as a Clojure CLI tool function (`clojure -T:mranderson inline-deps`).
The project's own `:source-paths` and the resolved dependency sources are
copied into `<target-path>/srcdeps`, with the dependency namespaces (and
references to them, including those in the project's own sources) rewritten
under `:project-prefix`.
Options:
- `:dependencies` (required) vector of `[lib version & kvs]` coordinates to
inline. Every entry is treated as an inline dep, so there
is no need to attach `^:inline-dep` meta yourself.
- `:source-paths` (required) the project's own source directories to copy
into `srcdeps` and rewrite.
- `:project-prefix` namespace/path prefix for the shadowed deps. Defaults to a
random `mranderson<hex>` prefix; set a stable value for
reproducible output.
- `:target-path` build target directory. Defaults to `"target"`; output is
written to `<target-path>/srcdeps`.
- `:repositories` Maven repositories used for resolution. Defaults to Maven
Central and Clojars (see `default-repositories`).
- `:pname` project name, used when repackaging bundled Java classes.
Defaults to `"mranderson"`.
- `:pversion` project version, used when repackaging bundled Java
classes. Defaults to `"0.0.0"`.
- `:skip-repackage-java-classes` skip jarjar repackaging of bundled `.class`
files. Defaults to `false`.
- `:prefix-exclusions` seq of prefixes to leave untouched when rewriting Java
imports.
- `:unresolved-tree` use unresolved-tree mode (deeply nested isolation).
Defaults to `false`.
- `:overrides` overrides for unresolved-tree mode.
- `:expositions` transitive deps to expose to the project's sources in
unresolved-tree mode.
- `:watermark` meta key marking inlined namespaces. Defaults to
`:mranderson/inlined`.
Returns the resolved project prefix (handy when it was generated).(mranderson repositories
dependencies
{:keys [skip-repackage-java-classes unresolved-tree pname pversion
overrides srcdeps prefix-exclusions]
:as ctx}
paths)Inline and shadow dependencies so they can not interfere with other libraries' dependencies.
repositories to resolve dependencies, dependencies list of dependencies to inline and shadow, ctx for opts and project specific attributes, paths for project specific paths.
ctx in detail:
Inline and shadow dependencies so they can not interfere with other libraries' dependencies.
`repositories` to resolve dependencies, `dependencies` list of dependencies to inline and shadow, `ctx` for opts and project specific attributes, `paths` for project specific paths.
`ctx` in detail:
- pname: project name
- pversion: project version
- pprefix: project prefix, defaults to mranderson{rnd}
- skip-repackage-java-classes: Skips shadowing java classes part of a dependency if true
- prefix-exclusions: prefixes to exclude when prefixing imports for java classes
- unresolved-tree: switch to unresolved tree mode if true
- overrides: overrides in the unresolved tree in unresolved tree mode
- expositions: transient dependencies made available for the project source files in unresolved tree mode
- watermark: meta flag to mark inlined dependenciescljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |