Skip to content

Commit

Permalink
Temp
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcompton committed Dec 17, 2017
1 parent c75836f commit 0c7e9c6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
3 changes: 2 additions & 1 deletion plugin/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
:license {:name "Eclipse Public License - v 1.0"
:url "http://www.eclipse.org/legal/epl-v10.html"}

:dependencies [[simple-lein-profile-merge "0.1.4"]]
:dependencies [[simple-lein-profile-merge "0.1.4"]
[org.clojure/clojure "1.8.0" :scope "provided"]]

:scm { :name "git"
:url "https://github.com/bhauman/lein-figwheel"
Expand Down
24 changes: 23 additions & 1 deletion plugin/src/leiningen/figwheel.clj
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
(not-empty (apply intersection (map set args)))))

(defn checkout-source-paths
"Get source paths for all of the lein projects that are in the checkouts directory."
"Get source paths for all of the lein projects in the checkouts directory."
[project]
(let [checkout-projects (lproject/read-checkouts project)
checkout-sources (for [co-project checkout-projects
Expand Down Expand Up @@ -410,6 +410,28 @@
(fuzzy-config-from-project project)
{:no-start-option true}))

(defn map-vals
"Returns a hashmap consisting of the result of applying f to
the value of each set in hashmap.
Function f should accept one single argument."
[f m]
(persistent!
(reduce-kv (fn [m k v] (assoc! m k (f v)))
(transient (empty m)) m)))

(defn update-builds
"Map a function across each cljsbuild build. The :cljsbuild :builds path
can either be a vector of builds or a map of build-ids to builds, so we
need to handle both."
[project f]
(if-let [builds (get-in project [:cljsbuild :builds])]
(assoc-in project
[:cljsbuild :builds]
(if (map? builds)
(map-vals f builds)
(map f builds)))
project))

(defn add-checkouts [project]
(let [checkout-paths (checkout-source-paths project)]
(update-in
Expand Down

0 comments on commit 0c7e9c6

Please sign in to comment.