If we want to build tooling around Polylith or e.g. use poly functionality in our
build.clj file, then we can use the clj-poly library
and get access to some of the functionality that is included in the poly command line tool.
The difference between the clj-poly library and the poly tool is that the latter is AOT compiled
into Java bytecode, while the library is just a normal Clojure library (source code that is zipped
into a jar file). This is good, because now we can expect the same behaviour from both.
We can use the poly tool as a library by including the clj-poly library
as a dependency to a project's deps.edn file, e.g.:
:aliases {:dostuff {...
:extra-deps {...
polylith/clj-poly {:mvn/version "0.2.19"}}
...or by selecting a sha from the polylith GitHub repo, e.g.:
...
polylith/clj-poly {:git/url "https://github.com/polyfy/polylith.git"
:sha "3b3e4ceac31d27f9a87862286f1ba01a3e4705ef"
:deps/root "projects/poly"}
As an example, the clj-poly library is first specified in the
build
alias in polylith's build.clj and then used in
build.clj.
If you need more access than is exposed by the API at the moment, just reach out to the Polylith team in Slack and we will try to help out.
All other code that is not part of the public API, is used at your own risk,
and may change in a breaking way between clj-poly versions.
If we want to build tooling around Polylith or e.g. use `poly` functionality in our
`build.clj` file, then we can use the [clj-poly](https://clojars.org/polylith/clj-poly) library
and get access to some of the functionality that is included in the `poly` command line tool.
The difference between the `clj-poly` library and the `poly` tool is that the latter is AOT compiled
into Java bytecode, while the library is just a normal Clojure library (source code that is zipped
into a jar file). This is good, because now we can expect the same behaviour from both.
We can use the `poly` tool as a library by including the `clj-poly` library
as a dependency to a project's `deps.edn` file, e.g.:
```clojure
:aliases {:dostuff {...
:extra-deps {...
polylith/clj-poly {:mvn/version "0.2.19"}}
```
...or by selecting a [sha](https://github.com/polyfy/polylith/commits/master) from
the polylith GitHub repo, e.g.:
```clojure
...
polylith/clj-poly {:git/url "https://github.com/polyfy/polylith.git"
:sha "3b3e4ceac31d27f9a87862286f1ba01a3e4705ef"
:deps/root "projects/poly"}
```
As an example, the `clj-poly` library is first specified in the
[build](https://github.com/polyfy/polylith/blob/5ff79341e7dc3fc6a486584c6c2f2f46cb577d6e/deps.edn#L120)
alias in polylith's `build.clj` and then used in
[build.clj](https://github.com/polyfy/polylith/blob/9e79264981b0c5be6e6cb70c93a540a82c489510/build.clj#L83).
If you need more access than is exposed by the API at the moment, just reach out to the
Polylith team in [Slack](https://clojurians.slack.com/messages/C013B7MQHJQ)
and we will try to help out.
All other code that is not part of the public API, is used at your own risk,
and may change in a breaking way between `clj-poly` versions.cljdoc 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 |