[
https://issues.apache.org/jira/browse/CB-11687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15422611#comment-15422611
]
ASF GitHub Bot commented on CB-11687:
-------------------------------------
Github user daserge commented on a diff in the pull request:
https://github.com/apache/cordova-lib/pull/480#discussion_r74917605
--- Diff: cordova-lib/src/cordova/prepare.js ---
@@ -37,23 +37,25 @@ function prepare(options) {
return Q().then(function() {
var projectRoot = cordova_util.cdProjectRoot();
var config_json = config.read(projectRoot);
- options = options || { verbose: false, platforms: [], options: {}
};
+ options = options || { verbose: false, options: {} };
+ options.platforms = options.platforms ||
cordova_util.listPlatforms(projectRoot);
--- End diff --
No, because preProcessOptions will throw `No platforms added to this
project` on restoring
([save.spec](https://github.com/apache/cordova-lib/blob/2a178662acfad9c779114fddd815e484fc1b6f1d/cordova-lib/spec-cordova/save.spec.js#L613)).
> 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]