cbt
cbt copied to clipboard
turn file change monitoring into plugin
if possible. would free CBT from barbary watchservice dependency. CBT would probably still have to provide support for exposing what files to watch, but how that is implemented would be pluggable
alternatively we might be able to make this a completely independent tool not related to cbt, which just receives a list of files to watch and an executable to run as arguments and let cbt provide them.
this actually might be such a tool already: https://facebook.github.io/watchman/docs/install.html as linked in #129
barbary watch service (https://github.com/cvogt/cbt/pull/420) seemed like it was buggy. crashed the jvm frequently. Now switched to fswatch (https://github.com/emcrisostomo/fswatch): https://github.com/cvogt/cbt/pull/429 . Not sure how it would have compared to watchman, but fswatch is cross platform and works great under osx where I tried it.
Seems to work for now. We can revisit splitting this from CBT's core some time in the future. But I am not sure if this is possible. Right now builds need to report what should be watched (and do so as a side-effect). And logic in the shell script inspects the cmd args to see if a user intends to look and then does it. So it is effectively implemented in the shell script.
If this feature was in a plugin, would a version of it still be available by default? Up until my experience with SBT this feature always required additional setup so I only used it on bigger projects. One of my favorite things moving to Scala initially was that I could always use ~test without any additional configuration.
Yeah, I totally agree this should be an out of the box experience! This ticket is only about potentially modularizing the internal implementation more so CBT's code gets slimmer.