practicalli

hairfire 2023-06-29T16:42:26.294709Z

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) 2023-06-29T16:43:59.185089Z

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) 2023-06-29T16:45:44.729419Z

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

hairfire 2023-06-29T16:46:45.594849Z

Wow! Thanks for the immediate response, Alex!

Alex Miller (Clojure team) 2023-06-29T16:58:42.057539Z

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

hairfire 2023-06-29T16:59:18.279859Z

Makes sense!

Alex Miller (Clojure team) 2023-06-29T16:59:35.059569Z

More explanation at https://clojure.org/reference/compilation if needed

hairfire 2023-06-29T17:00:28.705579Z

Thanks, again!