[
https://issues.apache.org/jira/browse/CB-10353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15134837#comment-15134837
]
ASF GitHub Bot commented on CB-10353:
-------------------------------------
Github user rakatyal commented on a diff in the pull request:
https://github.com/apache/cordova-docs/pull/489#discussion_r52063845
--- Diff: www/docs/en/dev/guide/appdev/hooks/index.md ---
@@ -22,61 +22,191 @@ title: Hooks Guide
# Hooks Guide
+## Introduction
+
Cordova Hooks represent special scripts which could be added by
application and
plugin developers or even by your own build system to customize cordova
commands.
-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`.
-__Note__: `/hooks` directory is considered deprecated in favor of the hook
elements
-in config.xml and plugin.xml.
-
-## Supported hook types
-The following hook types are supported:
-
- after_build
- after_compile
- after_clean
- after_docs
- after_emulate
- after_platform_add
- after_platform_rm
- after_platform_ls
- after_plugin_add
- after_plugin_ls
- after_plugin_rm
- after_plugin_search
- after_plugin_install // Plugin hooks in plugin.xml are executed for a
plugin being installed only
- after_prepare
- after_run
- after_serve
- before_build
- before_clean
- before_compile
- before_docs
- before_emulate
- before_platform_add
- before_platform_rm/
- before_platform_ls
- before_plugin_add
- before_plugin_ls
- before_plugin_rm
- before_plugin_search/
- before_plugin_install // Plugin hooks in plugin.xml are executed for a
plugin being installed only
- before_plugin_uninstall // Plugin hooks in plugin.xml are executed for
a plugin being uninstalled only
- before_prepare
- before_run
- before_serve
- pre_package // Windows and Windows Phone only
+There may be special activities that you would like to perform before
invoking
+cordova commands. For example, you may have a custom tool that checks for
code formatting
+in your javascript file. And, you would like to run this tool before every
build. In such
+a case, you could use a 'before_build' hook and instruct the cordova run
time to run the
+custom tool to be invoked before every build.
+
+There are 2 types of hooks:
+
+- Application specific hooks
+- Plugins related hooks
--- End diff --
Plugins specific hooks. Should we rename these to 'Application hooks' and
'Plugin hooks'?
> 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]