Skip to content

Commit

Permalink
update tools.build guide re namespace compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
puredanger committed Oct 27, 2023
1 parent b966164 commit 7c969a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion content/guides/tools_build.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,16 @@ An example build for a compiled uberjar will look like this:
(b/copy-dir {:src-dirs ["src" "resources"]
:target-dir class-dir})
(b/compile-clj {:basis basis
:src-dirs ["src"]
:ns-compile '[my.lib.main]
:class-dir class-dir})
(b/uber {:class-dir class-dir
:uber-file uber-file
:basis basis
:main 'my.lib.main}))
----

This example directs `compile-clj` to compile the main namespace (by default source will be loaded from the basis :paths). Compilation is transitive and all namespaces loaded by the compiled namespace will also be compiled. You may need to add additional namespaces if code is dynamically or optionally loaded.

The deps.edn and build execution will look the same as the prior example.

You can create the uber jar build with:
Expand Down

0 comments on commit 7c969a3

Please sign in to comment.