Fork me on GitHub
#practicalli
<
2023-06-29
>
hairfire16:06:26

On this page https://practical.li/clojure/clojure-cli/projects/tools-build/ , in the box titled "Java ARchive - jar file" is the sentence fragment "... and can contain Clojure sources or compiled class files from the project (or both)". I've been searching for a couple of hours now, and I can't find any instructions, sample projects, tutorials, or guides that show how to setup a project that uses tools-build/tools-deps to create a project that yields an uberjar with no source code and AoT compiled. I'm trying to create the smallest, fastest loading, .jar file I can for an IoT project. Any pointers would be greatly apperciated!

Alex Miller (Clojure team)16:06:59

The tools.build guide has an aot compiled uberjar example - you would just need to remove the one line that copies source to skip that

Alex Miller (Clojure team)16:06:44

That’s the call to b/copy-dir in that example

hairfire16:06:45

Wow! Thanks for the immediate response, Alex!

Alex Miller (Clojure team)16:06:42

I would also recommend setting the compile-clj compiler settings to use direct linking and elide meta if you’re looking for fastest and smallest, see https://clojure.github.io/tools.build/clojure.tools.build.api.html#var-compile-clj

hairfire16:06:18

Makes sense!

hairfire17:06:28

Thanks, again!