This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-15
Channels
- # aleph (24)
- # announcements (8)
- # babashka (27)
- # beginners (55)
- # biff (4)
- # calva (32)
- # cider (5)
- # clj-kondo (11)
- # clojure (59)
- # clojure-android (3)
- # clojure-australia (1)
- # clojure-belgium (6)
- # clojure-dev (21)
- # clojure-europe (26)
- # clojure-nl (1)
- # clojure-norway (17)
- # clojurescript (19)
- # css (1)
- # data-science (10)
- # datahike (17)
- # events (3)
- # figwheel-main (4)
- # honeysql (1)
- # hugsql (5)
- # hyperfiddle (1)
- # jobs (1)
- # leiningen (3)
- # lsp (6)
- # malli (5)
- # meander (4)
- # nbb (6)
- # off-topic (87)
- # pathom (19)
- # portal (2)
- # re-frame (4)
- # reitit (6)
- # releases (1)
- # remote-jobs (3)
- # shadow-cljs (29)
- # sql (8)
- # tools-deps (6)
- # xtdb (7)
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?
what do you mean by non-human-readable sources? most likely lein is not a source obfuscator or minifier
@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 )