Watch for macroses #92

Closed
si14 opened this Issue May 21, 2012 · 6 comments

3 participants

@si14

"cljsbuild auto" doesn't watch for macros changes, so one is forced to do "lein cljsbuild clean && lein cljsbuild once" manually, and this is painfully slow.

@emezeske
Owner

I think it would be pretty easy to have lein-cljsbuild watch the *.clj files in the clojurescript source directory, and do something like (require '[... :reload-all]) when they are modified.

This would only work for macros in the clojurescript source directory though. I can't think of a general way to watch for changes to macros in other directories (macros could be used from any *.clj file anywhere in the classpath). I wonder if this would be good enough for most uses?

@si14

Yeah, it would be great. You can also add a vector of additional pathes to watch in config to solve problems of other uses.

@superbobry

+1, exactly the feature I'm missing :)

As for a general way, how about adding an new configuration key to 'cljsbuild', something like:

:watch ["*.clj" "foo/bar/*.clj"]
@emezeske emezeske added a commit that closed this issue May 27, 2012
@emezeske Watch Clojure files in auto mode.
Clojure files from any ClojureScript :source-path, or from the
a :crossovers namespace that contains macros, are now watched for
changes.  When modified, the project is rebuilt.  Closes #92.
459b8f7
@emezeske emezeske closed this in 459b8f7 May 27, 2012
@emezeske
Owner

For the moment, I'm ignoring the general case of "run a build when any of these listed files changes", but that should be fairly easy to add later.

@si14

Thanks!

@emezeske
Owner

Thanks for motivating me to do this. I've wanted it for a long time, but have been lazy. :)

Let me know how it works for you. In my basic testing, it seems to work fine. I'm sure there's some edge case I missed, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment