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?
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
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
(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)
Thanks @noisesmith that answered my question