The idea for lazybuilder came up during a recent coding dojo doing code kata. We were using Vim and a separate terminal to run the tests. Switching back and forth between two windows when trying to move quickly seemed like a waste of time.

There are several tools in this space but most of them work by polling for changes or use linux events that are not available on a mac. lazy builder uses CoreServices.

I found during testing with a rails app that some events are received after the build has completed. To avoid looping I added a 100ms delay after a build. This is a bit of a hack and I am working on trying to recognize changes that are due to build activity as an alternative.

lazybuilder

with no parameters watches the current directory and runs make.

lazybuilder . rake

watches the current directory and runs rake

If you want to run more complex build commands enclose them in quotes:

lazybuilder . "raake test"

Roadmap

  • Improve cool down period
  • Avoid triggering build on temp file changes generated by emacs
  • Consider committing changes to version control (particularly git) if the build command is successful

If you get to try out lazy builder I would really appreciate feedback, bug reports and pull requests.

Installation

brew update && \
brew tap grahambrooks/lazybuilder && \
brew install lazybuilder

From Source

Installs to /usr/local/bin

git clone [email protected]:grahambrooks/lazybuilder.git
cd lazybuilder
make install