Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support :injections project key.

  • Loading branch information...
commit 751a75532ef4d2feff0b6e66a7267b5b9cf73f93 1 parent 326df95
@technomancy authored
View
15 leiningen-core/src/leiningen/core/eval.clj
@@ -42,16 +42,19 @@
;; # Form Wrangling
-(defn- injected-forms
- "Return the forms that need to be injected into the project for
- certain features (e.g. test selectors) to work."
- [project]
- ;; TODO: expose a way to disable these
+(def ^:private hooke-injection
(with-open [rdr (-> "robert/hooke.clj" io/resource io/reader PushbackReader.)]
`(do (ns ~'leiningen.core.injected)
~@(doall (take 6 (rest (repeatedly #(read rdr)))))
(ns ~'user))))
+(defn- injected-forms
+ "Return the forms that need to be injected into the project for
+ certain features (e.g. test selectors) to work."
+ [project]
+ (if-not (:disable-injection project)
+ (:injections project hooke-injection)))
+
(def prep-tasks
"A list of tasks to call before any code is evaluated inside the project."
(atom ["javac" "compile"]))
@@ -170,7 +173,7 @@
~@(let [user-clj (io/file (user/leiningen-home) "user.clj")]
(if (.exists user-clj)
[(list 'load-file (str user-clj))]))
- ~(injected-forms project)
+ ~@(injected-forms project)
(set! ~'*warn-on-reflection*
~(:warn-on-reflection project))
~form)))
View
1  src/leiningen/test.clj
@@ -25,6 +25,7 @@ each namespace and print an overall summary."
(apply require :reload '~namespaces)
~(form-for-hook-selectors selectors)
(let [failures# (atom #{})
+ ;; TODO: fall back for :disable-injected? already pretty hairy =\
_# (leiningen.core.injected/add-hook
#'clojure.test/report
(fn report-with-failures [report# m# & args#]
View
4 todo.org
@@ -15,11 +15,11 @@ See also https://github.com/technomancy/leiningen/issues
- [X] Rework prep function to ensure that AOT/javac happens when needed
- [X] Move pom generation to pomegranate or leiningen
- [X] More flexibility for jarring
+ - [X] Allow tasks to add in their own injections
+ - [X] Allow disabling of all injected code
- [ ] Hook up reply to nrepl for new repl task?
- [ ] Resurrect native deps?
- [ ] Honor hooks declared in plugin jar metadata?
- - [ ] Allow tasks to add in their own injections
- - [ ] Allow disabling of all injected code
- [ ] Pass user-level repository auth settings on to pomegranate.
- [ ] In-process eval-in-project? (possibly post-preview)
** Other stuff (post-preview)
Please sign in to comment.
Something went wrong with that request. Please try again.