Permalink
Browse files

Stop using project metadata for storing trampoline forms.

  • Loading branch information...
1 parent 69d3f80 commit d4acd839fd05e313f18c7e5b4bf4e9ef879f4767 @technomancy committed Aug 23, 2012
Showing with 19 additions and 18 deletions.
  1. +5 −2 leiningen-core/src/leiningen/core/eval.clj
  2. +11 −15 src/leiningen/trampoline.clj
  3. +3 −1 todo.org
@@ -173,9 +173,12 @@
(when (pos? exit-code)
(throw (ex-info "Subprocess failed" {:exit-code exit-code}))))))
+(defonce trampoline-forms (atom []))
+(defonce trampoline-deps (atom []))
+
(defmethod eval-in :trampoline [project form]
- (swap! (:trampoline-forms (meta project)) conj form)
- (swap! (:trampoline-deps (meta project)) conj (:dependencies project)))
+ (swap! trampoline-forms conj form)
+ (swap! trampoline-deps conj (:dependencies project)))
(defmethod eval-in :classloader [project form]
(when-let [classpath (map io/file (classpath/ext-classpath project))]
@@ -47,18 +47,14 @@ than as a subprocess of Leiningen's project.
Use this to save memory or to work around stdin issues."
[project task-name & args]
- (let [forms (atom []), deps (atom [])]
- (when (:eval-in-leiningen project)
- (main/info "Warning: trampoline has no effect with :eval-in-leiningen."))
- (binding [*trampoline?* true]
- (main/apply-task (main/lookup-alias task-name project)
- (-> (assoc project :eval-in :trampoline)
- (vary-meta assoc
- :trampoline-forms forms
- :trampoline-deps deps)
- (vary-meta update-in [:without-profiles] assoc
- :eval-in :trampoline))
- args))
- (if (seq @forms)
- (write-trampoline project @forms @deps)
- (main/abort task-name "did not run any project code for trampolining."))))
+ (when (= :leiningen (:eval-in project))
+ (main/info "Warning: trampoline has no effect with :eval-in-leiningen."))
+ (binding [*trampoline?* true]
+ (main/apply-task (main/lookup-alias task-name project)
+ (-> (assoc project :eval-in :trampoline)
+ (vary-meta update-in [:without-profiles] assoc
+ :eval-in :trampoline))
+ args))
+ (if (seq @eval/trampoline-forms)
+ (write-trampoline project @eval/trampoline-forms @eval/trampoline-deps)
+ (main/abort task-name "did not run any project code for trampolining.")))
View
@@ -12,7 +12,9 @@ See also https://github.com/technomancy/leiningen/issues
** 2.0.0-preview9
- [X] Fast trampolining
- [X] Latest newnew
- - [ ] Updated :eval-in :classloader
+ - [X] Updated :eval-in :classloader
+ - [ ] Vector for :repositories
+ - [ ] Fix middleware
** 2.0.0-preview8
- [X] Allow trampoline to work with chaining in do task (#665)
- [X] Store repl port on filesystem (#682)

0 comments on commit d4acd83

Please sign in to comment.