[
https://issues.apache.org/jira/browse/CB-6481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14094241#comment-14094241
]
ASF GitHub Bot commented on CB-6481:
------------------------------------
Github user csantanapr commented on the pull request:
https://github.com/apache/cordova-lib/pull/55#issuecomment-51937234
@sgrebnov I agree now that plugin hooks are located in a unique place like
plugins/mypluginid/src I can have my node module dependencies isolated without
impacting others. and now thinking about user needing to do npm install, I
think the node modules should be a short list so I can include node_modules
directory with the modules already installed with my plugin.
I just tried var nopt = context.requireCordovaModule('nopt');
maybe I did a typo before, when it was not working. so far I'm trying to
keep the hook simple without external dependencies.
on requireCordovaModule I think we should keep it for now, it's a very good
backdoor :-) we can use it during development to come up with what set of
things we want to expose.
For now I need a parser, so adding context.opts.parsers =[{ios:},
{android:}] and array with parser might be a good thing.
about context.cmdLine I see it now, I must be blind :-p
Go ahead and work CordovaProject, let me know if you need help or just
feedback.
I will continue to work on the hook for IBM, and add test cases for in
cordova-lib as I find use cases we want to cover in unit tests
> Add unified hooks support for cordova app and plugins
> -----------------------------------------------------
>
> Key: CB-6481
> URL: https://issues.apache.org/jira/browse/CB-6481
> Project: Apache Cordova
> Issue Type: New Feature
> Components: CLI, Plugman
> Reporter: Sergey Grebnov
> Assignee: Sergey Grebnov
>
> As per "Proposal: hooks support for plugins" dev mail thread discussion
> Hi, I have an idea how we can add more flexibility to plugin developers.
> Note, right now we have Application Developers – someone who use Cordova for
> developing applications and Plugin Developers – someone who creates plugins
> so that Application Developers can use them. For Application Developers we
> expose hooks so that they can customize their build/package/etc process. I
> want us to provide similar sort of flexibility to Plugin Developers so that
> they can go beyond of <source/>, <framework/> tags and get mechanism to add
> custom installation, build logic required by a plugin. Example usage will
> include: downloading/compiling additional binaries, marking source file to be
> copied to output dir, changing target build platform, etc. At present time
> the steps described could be only achieved by hooks manually added by
> Application Developer, but the right way is to allow Plugin Developer to
> expose this as part of plugin definition.
> Example configuration could look like
> ```
> <script type="postinstall" src="scripts/postinstall.js" />
> <script type="preinstall" src="scripts/preinstall.js" />
> <script type="install" src="scripts/install.js" />
> ```
> beforeinstall/preinstall – run before plugin is installed
> install/postinstall/afterinstall – run after plugin is installed
> uninstall – run after plugin is uninstalled
--
This message was sent by Atlassian JIRA
(v6.2#6252)