Warn on clojure.spec.alpha

This commit is contained in:
Michiel Borkent 2021-12-08 16:04:32 +01:00
parent ef8e4f48b9
commit 76c9d633ff

View file

@ -716,7 +716,7 @@ Use bb run --help to show this help output.
_ (when jar _ (when jar
(cp/add-classpath jar)) (cp/add-classpath jar))
load-fn (fn [{:keys [:namespace :reload]}] load-fn (fn [{:keys [:namespace :reload]}]
(when-let [{:keys [:loader]} (or (when-let [{:keys [:loader]}
@cp/cp-state] @cp/cp-state]
(if ;; ignore built-in namespaces when uberscripting, unless with :reload (if ;; ignore built-in namespaces when uberscripting, unless with :reload
(and uberscript (and uberscript
@ -726,7 +726,12 @@ Use bb run --help to show this help output.
"" ""
(let [res (cp/source-for-namespace loader namespace nil)] (let [res (cp/source-for-namespace loader namespace nil)]
(when uberscript (swap! uberscript-sources conj (:source res))) (when uberscript (swap! uberscript-sources conj (:source res)))
res)))) res)))
(case namespace
clojure.spec.alpha
(binding [*out* *err*]
(println "[babashka] WARNING: Use the babashka-compatible version of clojure.spec.alpha, available here: https://github.com/babashka/spec.alpha"))
nil)))
main (if (and jar (not main)) main (if (and jar (not main))
(when-let [res (cp/getResource (when-let [res (cp/getResource
(cp/loader jar) (cp/loader jar)