Fork me on GitHub
#leiningen
<
2020-06-29
>
jacklombard09:06:53

What is the difference between :aot :all and :aot [my-project.core] in the uberjar profile? where my-project.core has the main function. Will lein uberjar recursively go through all the requires and compile them?

noisesmith15:06:03

clojure's compile, which uberjar uses, is "recursive" in the sense that if your compiled ns has require statements at the top level, those namespaces will also be loaded and compiled

noisesmith15:06:54

in fact there's a trick, when you don't want to / can't aot compile certain namespaces, of hiding the require inside a function so it won't run during compilation and only happens at at runtime

noisesmith15:06:07

(this means you also need to use resolve, the situation is common enough that clojure now has a requiring-resolve function that combines loading something's namespace, and looking it up and calling it, into one invocation)

jacklombard15:06:41

Thanks @U051SS2EU that answered my question