Skip to content

Commit

Permalink
Check out each.clj from master
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Hanlon committed Oct 1, 2020
1 parent 7440841 commit f0a2a74
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/lein_monolith/task/each.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
[lein-monolith.task.util :as u]
[leiningen.core.eval :as eval]
[leiningen.core.main :as lein]
[leiningen.core.project :as project]
[leiningen.core.utils :refer [rebind-io!]]
[leiningen.do :as lein-do]
[manifold.deferred :as d]
Expand Down Expand Up @@ -192,11 +193,22 @@
exit-value)))))


(def ^:private init-lock
"An object to lock on to ensure that projects are not initialized
concurrently. This prevents the mysterious 'unbound fn' errors that sometimes
crop up during parallel execution."
(Object.))


(defn- apply-subproject-task
"Applies the task to the given subproject."
[subproject task]
(binding [lein/*exit-process?* false]
(let [initialized (plugin/init-subproject subproject)]
(binding [lein/*exit-process?* false
eval/*dir* (:root subproject)]
(let [initialized (config/debug-profile "init-subproject"
(locking init-lock
(project/init-project
(plugin/add-middleware subproject))))]
(config/debug-profile "apply-task"
(lein/resolve-and-apply initialized task)))))

Expand Down

0 comments on commit f0a2a74

Please sign in to comment.