Fork me on GitHub
#leiningen
<
2022-11-15
>
Yuner Bekir11:11:20

I am trying to generate a jar of my project with the properties :aot :all and :omit-source true with the command lein install. I end up with a jar containing all of the dependencies of the project. I tried running without :aot :all and I got only my files but in their raw, human readable form. How can I generate a jar which will include only the source files, without dependencies and it will not be human readable?

vemv15:11:24

what do you mean by non-human-readable sources? most likely lein is not a source obfuscator or minifier

mikerod20:11:38

@U01B65G1Z63 Sounds like you want AOT classfiles for only your direct source files. And you do not want to include those source files in the resulting jar. You don’t want an uberjar, you just want AOT compiled “slim” jar. This has never been something CLJ directly supports. AOT compilation doesn’t have an ability to “stop at the boundaries” of any particular project/package/module/namespaces. I think https://clojure.atlassian.net/browse/CLJ-322 has some history there. However, build tools, like lein can attempt to do this as a post-processing step and its typically ok in normal flows. I think what you are looking for is a mix of AOT compilation + :omit-source + :clean-non-project-classes (see https://github.com/technomancy/leiningen/blob/2.9.8/sample.project.clj#L344 )

2