tools-build

mike_ananev 2024-04-14T14:36:18.754969Z

Hi! I want to exclude sources of my application (*.clj) from uberjar. To acheive this I excluded src folder on step b/copy-dir . Is it correct way? This is my uber function from build.clj file.

(defn uber
  [_]
  (println "Project:")
  (clojure.pprint/pprint project-env)
  (b/copy-dir {:src-dirs   ["resources"]
               :target-dir class-dir})
  (b/compile-clj {:basis     basis
                  :src-dirs  ["src"]
                  :class-dir class-dir})
  (b/uber {:class-dir class-dir
           :uber-file uber-file
           :basis     basis
           :main      main-ns}))

Alex Miller (Clojure team) 2024-04-30T11:12:38.957459Z

Yes, that will work

Alex Miller (Clojure team) 2024-04-29T12:05:10.931369Z

Most libs are distributed source-only so you can’t exclude that

Alex Miller (Clojure team) 2024-04-29T12:05:47.113479Z

Unless you ensure you have aot compiled every namespace you might need

jumar 2024-04-30T06:28:43.346259Z

I’m sure :) And I also want to only exclude our org namespaces not 3rd party The exclude option seems to do the job afaict

Alex Miller (Clojure team) 2024-04-14T14:40:54.370179Z

yep!

👍 1
jumar 2024-04-29T04:01:52.415209Z

I'm also wondering about this. What about the sources in dependencies? Is it maybe better to :exclude ?