From 71c819a6472de908d61b708f0fc4c0f1300cbe6a Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Wed, 30 Nov 2022 13:16:31 +0100 Subject: [PATCH] fix --- resources/META-INF/babashka/deps.edn | 2 +- src/babashka/main.clj | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/META-INF/babashka/deps.edn b/resources/META-INF/babashka/deps.edn index eb07e9a8..4e875585 100644 --- a/resources/META-INF/babashka/deps.edn +++ b/resources/META-INF/babashka/deps.edn @@ -63,7 +63,7 @@ :lib-tests {:extra-paths ["process/src" "process/test" "test-resources/lib_tests"] :extra-deps {org.clj-commons/clj-http-lite {:mvn/version "0.4.392"} - org.babashka/spec.alpha {:git/url "https://github.com/babashka/spec.alpha" + #_#_org.babashka/spec.alpha {:git/url "https://github.com/babashka/spec.alpha" :sha "0dec1f88cbde74a0470b454396f09a03adb4ae39"} lambdaisland/regal {:mvn/version "0.0.143"} cprop/cprop {:mvn/version "0.1.16"} diff --git a/src/babashka/main.clj b/src/babashka/main.clj index b0bf4b04..4810a0e2 100644 --- a/src/babashka/main.clj +++ b/src/babashka/main.clj @@ -824,7 +824,7 @@ Use bb run --help to show this help output. (assoc core-extras 'load-file (sci-copy-vars/new-var 'load-file load-file*)))) :features #{:bb :clj} - :classes @classes/class-map + :classes classes/class-map* :imports classes/imports :load-fn load-fn ;; :readers core/data-readers @@ -839,6 +839,9 @@ Use bb run --help to show this help output. (def sci-ctx (new-sci-ctx)) +#_(sci/binding [core/warn-on-reflection @core/warn-on-reflection] + (sci/eval-form sci-ctx '(require '[clojure.spec.alpha]))) + (defn exec [cli-opts] (binding [*unrestricted* true] (sci/binding [core/warn-on-reflection @core/warn-on-reflection @@ -990,6 +993,11 @@ Use bb run --help to show this help output. ;; execute code (sci/binding [sci/file abs-path] (try + (run! (fn [s] + (sci/add-class! sci-ctx s + (Class/forName (str s)))) + (when features/java-net-http? + classes/java-net-http-classes)) ;; when evaluating expression(s), add in repl-requires so things like ;; pprint and dir are available (sci/eval-form sci-ctx `(apply require (quote ~clojure-main/repl-requires)))