Print meta when eval-in-subprocess

This fixes the issue with reflection warnings in #2045, but
unfortunately breaks backwards compatibility with 1.1.0. So the lowest
version of Clojure Leiningen now supports is 1.2.0.
This commit is contained in:
Jean Niklas L'orange 2016-02-04 23:24:37 +01:00
parent 5cbd7b0f28
commit 99d53683eb
2 changed files with 9 additions and 7 deletions

View file

@ -245,9 +245,10 @@
(io/file (:target-path project) (str checksum "-init.clj"))
(File/createTempFile "form-init" ".clj"))]
(spit init-file
(pr-str (if-not (System/getenv "LEIN_FAST_TRAMPOLINE")
`(.deleteOnExit (File. ~(.getCanonicalPath init-file))))
form))
(binding [*print-dup* true]
(pr-str (if-not (System/getenv "LEIN_FAST_TRAMPOLINE")
`(.deleteOnExit (File. ~(.getCanonicalPath init-file))))
form)))
`(~(or (:java-cmd project) (System/getenv "JAVA_CMD") "java")
~@(classpath-arg project)
~@(get-jvm-args project)
@ -324,7 +325,8 @@
:port (Integer. (slurp port-file)))
client (client-session (client transport Long/MAX_VALUE))
pending (atom #{})]
(message client {:op "eval" :code (pr-str form)})
(message client {:op "eval" :code (binding [*print-dup* true]
(pr-str form))})
(doseq [{:keys [out err status session] :as msg} (repeatedly
#(recv transport 100))
:while (not (done? msg pending))]
@ -364,6 +366,7 @@
"Executes form in isolation with the classpath and compile path set correctly
for the project. If the form depends on any requires, put them in the init arg
to avoid the Gilardi Scenario: http://technomancy.us/143"
([project form] (eval-in-project project form nil))
([project form init]
(prep project)
(when (:warn-on-reflection project)
@ -375,5 +378,4 @@
~@(map (fn [[k v]] `(set! ~k ~v)) (:global-vars project))
~init
~@(:injections project)
~form)))
([project form] (eval-in-project project form nil)))
~form))))

View file

@ -4,5 +4,5 @@
;; "lein new".
(defproject nomnomnom "0.5.0-SNAPSHOT"
:dependencies [[~(symbol "org.clojure" "clojure") ~"1.1.0"]]
:dependencies [[~(symbol "org.clojure" "clojure") ~"1.2.0"]]
:aot [nom.nom.nom])