Beginner tutorial for building Clojure using deps.edn

Hello friends,

I learned how to write a program and then “run it” in Leiningen repl lein repl and how to run tests using lein test but I’m struggling to get a good up-to-date resource to learn how to make a binary out of it.

Could you please point me to a book / web / example that would teach me how to do that using deps.edn?

I vaguely understand that there are differences for “dev” and “release” but I know that I actually don’t know what I want and that’s probably the main reason why most of content I found around deps.edn is hard to understand since deps.edn is more DIY than Leiningen. But that’s also the reason why I want to try it out ;-).

Thank you.

1 Like

Here is a quickstart: New Clojure project quickstart
From there you can dig deeper into the official docs.

For creating binaries: do you mean GraalVM binaries?
Here’s a little example of that: GitHub - borkdude/jayfu: Jayfu is a tutorial on how to create a Clojure CLI with GraalVM native-image and SCI.

1 Like

Thank you! And thanks for neil!

(sorry, I meant executable, not binary - which means I need uberjar)

I’ve just been updating Practicalli Clojure free online book with a guide to Clojure CLI, including tools.build example for creating jars and uberjars. The book also includes videos to show the Clojure workflow with Clojure CLI.

The book includes a user configuration for Clojure CLI that provides a wide range of tools that extend the built-in features (test runners, hotloading libraries, searching for libraries and versions, format tools, rich repl ui, etc.)

Note: the tooling to create the book has had a major upgrade, so there may still be a few issues (although they should be fixed in the next few days)

2 Likes

Nice, thank you! I’ll check if you have Patreon / Github sponsors since book authors should be thanked ;-).

First time I heard about tools.build and looking at the Github it is used inside deps.edn to build jar. So definitely useful ;-). Thank you.

It took me a while to adopt tools.build as I didn’t really want to script the build process for each project. All my projects just create a jar or uberjar

However the build.clj script doesn’t need to change so can start as boilerplate code, the same in each project.

If there is need to change the build process, then tools.build makes this easy to do. I would like to see some examples of what people have found useful.

I’m assuming some ClojureScript projects may benefit from tools.build, e.g like copying web assets

Also if there is more complexity in the build, over creating a jar or uberjar, then tools.build could be very useful.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.