Merge lp:~rharding/launchpad/watch_jsbuild into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Richard Harding |
Approved revision: | no longer in the source branch. |
Merged at revision: | 14881 |
Proposed branch: | lp:~rharding/launchpad/watch_jsbuild |
Merge into: | lp:launchpad |
Prerequisite: | lp:~rharding/launchpad/use_lpjsmin |
Diff against target: |
93 lines (+40/-1) 4 files modified
Makefile (+5/-1) buildout-templates/bin/watch_jsbuild.in (+31/-0) buildout.cfg (+2/-0) versions.cfg (+2/-0) |
To merge this branch: | bzr merge lp:~rharding/launchpad/watch_jsbuild |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
j.c.sackett (community) | Approve | ||
Review via email: mp+94379@code.launchpad.net |
Commit message
[r=jcsackett]
Description of the change
= Summary =
In order to test and work with JS changes, you need to rebuild the JS files into the combo root, minimize, etc. This is done from the command `make jsbuild`, but it's a manual command that severly slows down development.
This adds a new make command `make jsbuild_watch` that will run a constant process, watching for changed JS files, and auto building them on the fly. In this way you shouldn't have to manually run `make jsbuild` while the process is running.
The only works for the combo loader and so isn't helpful if that feature flag isn't enabled.
== Proposed Fix ==
Adds a watch script and a make command to start it up manually. It runs and is killed with just a ctrl-c for now.
== Implementation Details ==
The watch_jsbuild.py script watching any changed files in lib. It checks them to see if they're non-test JS files. If so, it copies and minifies them into the build directory for the combo loader.
The script uses pyinotify to watch the lib directory and all sub directories for changed files.
As we discussed in IRC, the event.mask == pyinotify.IN_MODIFY should be changed to .IN_CREATE in the process_IN_CREATE method.