[
https://issues.apache.org/jira/browse/CB-10353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15157825#comment-15157825
]
ASF GitHub Bot commented on CB-10353:
-------------------------------------
Github user riknoll commented on a diff in the pull request:
https://github.com/apache/cordova-docs/pull/489#discussion_r53703389
--- Diff: www/docs/en/dev/guide/appdev/hooks/index.md ---
@@ -115,41 +218,86 @@ As a plugin developer you can define hook scripts
using `<hook>` elements in a `
<hook type="before_plugin_install" src="scripts/beforeInstall.js" />
<hook type="after_build" src="scripts/afterBuild.js" />
- <platform name="wp8">
- <hook type="before_plugin_install"
src="scripts/wp8BeforeInstall.js" />
- <hook type="before_build" src="scripts/wp8BeforeBuild.js" />
+ <platform name="android">
+ <hook type="before_plugin_install"
src="scripts/androidBeforeInstall.js" />
+ <hook type="before_build" src="scripts/androidBeforeBuild.js" />
...
</platform>
-`before_plugin_install`, `after_plugin_install`, `before_plugin_uninstall`
plugin hooks will be fired exclusively for the plugin being
installed/uninstalled.
+`before_plugin_install`, `after_plugin_install`, `before_plugin_uninstall`
plugin hooks will be fired
+exclusively for the plugin being installed/uninstalled.
+
+### Via `/hooks` directory (Deprecated)
+
+To execute custom action when corresponding hook type is fired, use hook
type as a name for a subfolder inside 'hooks' directory and place you script
file here, for example:
+
+ # script file will be automatically executed after each build
+ hooks/after_build/after_build_custom_action.js
+
+When using these hooks, they will always be run as executable files, not
as loadable JavaScript modules.
+
+__Remember__: Make your scripts executable in this case.
+
+__Note__: this method is considered deprecated in favor of the hook
elements in config.xml and plugin.xml.
+
+### Order of Hooks execution
+
+#### Based on Hooks Definition
+
+Hook scripts could be defined by adding them to the special predefined
folder
+(`/hooks`) or via configuration files (`config.xml` and `plugin.xml`) and
run
+serially in the following order:
+
+* Application hooks from `/hooks`;
+* Application hooks from `config.xml`;
+* Plugin hooks from `plugins/.../plugin.xml`.
+
+#### Based on the Internal order of execution
+
+The internal order of execution of hooks is fixed.
+
+##### Example 1
--- End diff --
Make it clear in these examples what Cordova CLI command is being run.
Instead of calling these Example 1 and Example 2, give them more descriptive
headers. A person scrolling through the page should be able to find what they
are looking for.
> Make Hooks guide a reference
> ----------------------------
>
> Key: CB-10353
> URL: https://issues.apache.org/jira/browse/CB-10353
> Project: Apache Cordova
> Issue Type: Task
> Components: Docs
> Reporter: Raghav
> Assignee: Sarangan Rajamanickam
> Labels: Docs-6.x
>
> Hooks guide
> (https://cordova.apache.org/docs/en/latest/guide/appdev/hooks/index.html)
> needs to be modified as per the reference structure.
> General guidelines:
> - While giving examples, keep them short. Do not repeat for all
> plugins/platforms.
> - Remove all references to cordova plugin registry.
> - Remove Tizen references. The platform is deprecated
> (http://markmail.org/message/hryg6sjswecpgndu)
> - Keep information up to date for the platforms, CLI and plugins
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]