Skip to content

Commit

Permalink
whatever
Browse files Browse the repository at this point in the history
  • Loading branch information
hiredman committed Jul 17, 2021
1 parent fcd265d commit 3709c1b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main/clojure/clojure/tools/build/tasks/compile_clj.clj
Expand Up @@ -25,10 +25,14 @@

(defn- write-compile-script!
^File [^File script-file ^File compile-dir nses compiler-opts]
(let [script `(binding [~'*compile-path* ~(str compile-dir)
~'*compiler-options* ~compiler-opts]
~@(map (fn [n] `(~'compile '~n)) nses)
(System/exit 0))]
(let [script `(do
(when-not *compile-files*
(binding [~'*compile-path* ~(str compile-dir)
~'*compiler-options* ~compiler-opts]
(compile 'your-code)
(System/exit 0)))
(ns your-code
(:require ~@nses)))]
(spit script-file (with-out-str (pprint/pprint script)))))

(defn- ns->path
Expand All @@ -43,7 +47,7 @@
nses (or ns-compile
(mapcat #(find/find-namespaces-in-dir (api/resolve-path %) find/clj) src-dirs))
working-compile-dir (file/ensure-dir (jio/file working-dir "compile-clj"))
compile-script (jio/file working-dir "compile.clj")
compile-script (jio/file working-dir "your_code.clj")
_ (write-compile-script! compile-script working-compile-dir nses compile-opts)
cp-str (->> (-> classpath keys (conj (.getPath working-compile-dir) (.getPath compile-dir-file)))
(map #(api/resolve-path %))
Expand Down

0 comments on commit 3709c1b

Please sign in to comment.