Skip to content

Commit

Permalink
Handle missing :cljsbuild configuration.
Browse files Browse the repository at this point in the history
When :cljsbuild entry is not found:
- Emit project name in warning.
- For checkouts, skip extraction of source paths (assume no cljs).
- Suppress deprecated warning (previous warning is sufficient).
  • Loading branch information
Corin Lawson authored and mneise committed Sep 27, 2017
1 parent a9b8935 commit 644f4cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions plugin/src/leiningen/cljsbuild.clj
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,10 @@
(walk-checkouts
project
(fn [checkout]
(let [{:keys [builds]} (config/extract-options checkout)
root (:root checkout)]
(if-let [{:keys [builds]} (config/extract-options checkout)]
(for [build builds
path (:source-paths build)]
(fs/absolute-path (io/file root path)))))))
(fs/absolute-path (io/file (:root checkout) path)))))))

(defn- run-compiler [project {:keys [crossover-path crossovers builds]} build-ids watch?]
(doseq [build-id build-ids]
Expand Down
8 changes: 4 additions & 4 deletions plugin/src/leiningen/cljsbuild/config.clj
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@
(defn- normalize-options
"Sets default options and accounts for backwards compatibility."
[target-path options]
(let [options (convert-builds-map options)
compat (backwards-compat options)]
(when (not= options compat)
(let [convert (convert-builds-map options)
compat (backwards-compat convert)]
(when (and options (not= convert compat))
(warn-deprecated compat))
(->> compat
(set-default-options target-path)
Expand Down Expand Up @@ -180,6 +180,6 @@
"Given a project, returns a seq of cljsbuild option maps."
[project]
(when (nil? (:cljsbuild project))
(println "WARNING: no :cljsbuild entry found in project definition."))
(println "WARNING: no :cljsbuild entry found in" (:name project) "project definition."))
(let [raw-options (:cljsbuild project)]
(normalize-options (:target-path project) raw-options)))

0 comments on commit 644f4cf

Please sign in to comment.