workspace.edn
in a text editor and set :auto-add
to true
:create
command is also added to git, which will come in handy in this example (normally we will leave the setting as it is). poly info
- using the compiled version of the tool.clojure -M:poly info
- using Clojure CLI from the workspace directory.clojure -Tpoly info
- as a Clojure CLI Toolpoly
:deps.edn
. If we don't, then tools.deps and the development environment will not recognize our newly created component, which would be a pity! The tool leaves this task to you as a developer, with the idea to give you as much control as possible (files are only edited by you, not by the tool).deps.edn
files, because no projects have been created yet.src
, resources
and test
directory to deps.edn
::extra-deps
(the development/src
directory still has to be specified as a path):components/user/src
as a source directory in the IDE (it will not be marked as green). This is also why we use the first form in this example.resources
directory from a brick, without updating ./deps.edn
.user
by using :extra-paths
because we use Cursive in this example.test
directory to ./deps.edn
to be able to run the tests.deps.edn
file that looks like this:src
, resources
and test
directory and will later be needed by the projects that include this component.development
project, one user
component and one user
interface but no base (yet). Components and bases are referred to as bricks
(we will soon explain what a base is). The cryptic s--
and st-
will be described in the flags section.core
namespace to user
:interface
to:Note: Use the copy icon when copying the text from these examples, otherwise all the lines will be copied into one single line, and the "new line" characters will not be included. If you use Firefox, you need to switch to another browser (it doesn't work in Firefox).
core
namespace, which is the recommended way of structuring the code in Polylith. Here we put all our implementing code in one single namespace, but as the codebase grows, more namespaces can be added to the component when needed. The implementing core
namespace can be renamed to something else, but here we choose to keep it as it is.