pandeiro / boot-http

A simple HTTP serve task for the Boot build tool
62 stars 34 forks source link

pass env dirs to wrap-reload #27

Closed mecha1 closed 8 years ago

mecha1 commented 8 years ago

I noticed that reloading doesn't work unless your source directory starts with src. @Deraen pointed out that this is because boot-http calls wrap-reload without specifying the :dirs option, so it defaults to only reloading things under src. This patch feeds the :directories from the boot environment into the call to wrap-reload so that reloading will work for whatever source directories are configured.

mecha1 commented 8 years ago

FYI I also updated the boot version to latest (2.4.2) and added a boot.properties file to pin the version.

pandeiro commented 8 years ago

Nice! Thanks for this. I'm just not sure where the :directories is coming from, here. I left a note on the line in question.

mecha1 commented 8 years ago

Good point, I think :source-paths is better here. I updated the pull request accordingly.

Deraen commented 8 years ago

Source-paths won't work correctly as it doesn't include resource-paths, which might include clj files. Or source-paths could even be empty and all sources could be in resource-paths.

Also, instead of looking directly at input directories, it's better to watch the boot temp directories. This way if you have namespaces created by boot tasks, they would also work correctly.

Deraen commented 8 years ago

Also, if input-directories are watched, it's possible that ns-tracker will see some namespaces as changed before the change is synchronized to Boot temp dir and thus classpath.

mecha1 commented 8 years ago

Better points. :-) I think what we really want are just the synchronized input dirs, but it doesn't look like there is a way to get that out of the env aside from :directories. I can easily revert back to this. @pandeiro, thoughts?

pandeiro commented 8 years ago

I don't actually use the :reload parameter much myself, so I'll defer to @Deraen and those who do. I'm not actually sure what :directories even is -- is this a special key in the Boot environment? Are there docs anywhere for that?

mecha1 commented 8 years ago

I had a chat w/micha on slack to ask about this. He recommended using :directories as well, and noted that we can get access to it from boot.pod/env as well. The stuff in :directories are the input dirs (source + resource); or more specifically the locations boot manages in order to maintain its immutable fileset abstraction for the input dirs.

pandeiro commented 8 years ago

@mecha1 Sorry for taking a while. Gonna merge this, bump the snapshot, and test it out more thoroughly OK? Thanks a lot!

mecha1 commented 8 years ago

thanks!