Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only reload Clojure source files that define macros (fixes gh-210) #211

Merged
merged 1 commit into from
Aug 30, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion support/src/cljsbuild/compiler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[cljs.analyzer :as analyzer]
[cljs.closure :as closure]
[clojure.string :as string]
[clojure.java.io :as io]
[fs.core :as fs]))

(def reset-color "\u001b[0m")
Expand Down Expand Up @@ -95,7 +96,13 @@
; not affect any cljs file mtimes, we have to clear the cache here to force everything
; to be rebuilt.
(fs/delete-dir (:output-dir compiler-options))
(doseq [path paths]
(doseq [path paths
; only Clojure files that define macros can possibly affect
; ClojureScript compilation; those that don't might define the "same"
; namespace as a same-named ClojureScript file, and thus interfere
; with cljsc's usage of Clojure namespaces during compilation. gh-210
:when (-> path (string/replace #"^/" "") io/resource
^String slurp (.contains "defmacro"))]
(try
(load (drop-extension path))
(catch Throwable e
Expand Down