Github user vladimir-kotikov commented on a diff in the pull request:
https://github.com/apache/cordova-lib/pull/304#discussion_r39400734
--- Diff: cordova-lib/src/cordova/plugin.js ---
@@ -283,6 +283,31 @@ module.exports = function plugin(command, targets,
opts) {
}
};
+/**
+ * Calls `platformApi.prepare` for each platform in project
+ *
+ * @param {string[]} platformList List of platforms, added to current
project
+ * @param {string} projectRoot Project root directory
+ *
+ * @return {Promise}
+ */
+function preparePlatforms (platformList, projectRoot) {
+ return Q.all(platformList.map(function(platform) {
+ // TODO: this need to be replaced by real projectInfo
+ // instance for current project.
+ var project = {
+ root: projectRoot,
+ projectConfig: new
ConfigParser(cordova_util.projectConfig(projectRoot)),
+ locations: {
+ plugins: path.join(projectRoot, 'plugins'),
+ www: cordova_util.projectWww(projectRoot)
+ }
+ };
+
+ return platforms.getPlatformApi(platform).prepare(project);
+ }));
+}
+
--- End diff --
Yup, factored this to separate function. Another thing that i've missed, is
that we still need to do a `browserify` if corresponding option is specified.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]