For anyone interested, the approach I ended up taking was to AOT everything all 
the time. But, require the class namespaces to be explicitly defined in the 
build config file for any which needs to be included in the Jar. And when 
packaging the Jar, only the Clojure source and the AOT class files of the 
namespaces that were explicitly listed are included.

I do that by compiling every source files, and then deleting all .class files 
except for the ones that match the explicitly listed namespaces. If no 
namespace are listed, then the resulting Jar is thus similar to a non AOT 
build, and only includes source. 

The advantages are that the AOT compilation bubbles compile issues early at 
build time. And the resulting Jars do not include transitive classes that could 
cause version conflicts. And when you need gen-class, you can include only the 
gen-class .class in the Jar, not even have its containing namespace. Minimizing 
the blast radius of AOT. And if you face the protocol issue, you can specify 
these namespaces as well to ne included in the Jar.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to