apache/cordova-lib — pull request #55 by sgrebnov (2014-07-09 16:18:59+00:00)
Title: CB-6481 Add unified hooks support for cordova app and plugins

https://issues.apache.org/jira/browse/CB-6481

Added the following changes and new features
* Hooks can be defined in .cordova/hooks/hook_type, hooks/hook_type directories, **config.xml** (by application developers) and plugins/.../**plugin.xml** (by plugins developers)
* Javascript hooks retrieved from config.xml and plugins/.../plugin.xml will be run via new module loader with special **Context argument** passed. This object represents current hook script execution context including hook type, cordova version, paths, plugin info and other special utility modules.
* Introduced **before_plugin_install**, **after_plugin_install** and **before_plugin_uninstall** hooks.

See updated docs for more details:
https://github.com/MSOpenTech/cordova-lib/commit/952690b7d7b42962b4e246c2b84c309846bf8750?short_path=8c918a9#diff-8c918a9f452feb5e3ef3339749806fc3

Please note, that there are some remaining work items here below before we can merge it. The PR has been sent to get community feedback and adjust implementation while we are working on unit tests.
* Write unit test (in-progress)
* Replace original Hooker with new implementation everywhere, Currently 'before_build' is supported for general application hooks.