[ 
https://issues.apache.org/jira/browse/CB-11687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15421224#comment-15421224
 ] 

Sergey Shakhnazarov commented on CB-11687:
------------------------------------------

We can't just populate {{options.platforms}} with installed project platforms 
before firing {{before_prepare}} because hooks will fail in case we don't yet 
have platforms/plugins to be installed in restore step.
The correct solution is probably to fix the prepare flow so that we have 
{{restore(platforms), restore(plugins), fire(before_prepare), prepare, 
fire(after_prepare)}} but it might be a breaking change.

> platform-specific plugin prepare hooks should be run even when no platforms 
> are specified
> -----------------------------------------------------------------------------------------
>
>                 Key: CB-11687
>                 URL: https://issues.apache.org/jira/browse/CB-11687
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaLib
>            Reporter: Sergey Shakhnazarov
>            Assignee: Sergey Shakhnazarov
>
> plugin.xml:
> {code}
>   <platform name="windows">
>     <hook type="before_build" src="hooks/windows/hook.js"/>
>     <hook type="before_prepare" src="hooks/windows/hook.js"/>
>     <hook type="after_build" src="hooks/windows/hook.js"/>
>     <hook type="after_prepare" src="hooks/windows/hook.js"/>
> {code}
> hook.js:
> {code}
> module.exports = function(context) {
>     console.log('context.hook: ' + context.hook);
> }
> {code}
> {{cordova prepare --verbose  | findstr "context.hook"}} # no hooks runs
> {{cordova build --verbose  | findstr "context.hook"}} # before_build, 
> before_prepare, after_prepare, after_build runs
> Expected - {{cordova prepare}} should run plugin' platform-specific hooks as 
> well.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to