Skip to content

Add path exclude option to aot task. #234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions boot/core/src/boot/task/built_in.clj
Original file line number Diff line number Diff line change
Expand Up @@ -527,19 +527,29 @@
(-> fileset (core/add-resource tgt) core/commit!))))

(core/deftask aot
"Perform AOT compilation of Clojure namespaces."
"Perform AOT compilation of Clojure namespaces.

[a all bool "Compile all namespaces."
n namespace NS #{sym} "The set of namespaces to compile."]
The exclude option can be used control what source paths should not be
compiled, exclude defaults to:

[#\"data_readers.clj$\"]
"

[a all bool "Compile all namespaces."
e exclude PATH [regex] "The set of regexes that source paths must not match."
n namespace NS #{sym} "The set of namespaces to compile."]

(let [tgt (core/tmp-dir!)
pod-env (update-in (core/get-env) [:directories] conj (.getPath tgt))
compile-pod (future (pod/make-pod pod-env))]
(core/with-pre-wrap fileset
(core/empty-dir! tgt)
(let [nses (->> (core/input-files fileset)
(let [exclude? #(->> (or exclude [#"data_readers\.clj$"])
(map (fn [r] (re-find r %))) (some identity) not)
nses (->> (core/input-files fileset)
(map core/tmp-path)
(filter #(.endsWith % ".clj"))
(filter exclude?)
(map util/path->ns)
(filter #(or all (contains? namespace %)))
sort)]
Expand Down