[
https://issues.apache.org/jira/browse/CB-11022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15245351#comment-15245351
]
ASF GitHub Bot commented on CB-11022:
-------------------------------------
Github user vladimir-kotikov commented on a diff in the pull request:
https://github.com/apache/cordova-windows/pull/167#discussion_r60028006
--- Diff: template/cordova/lib/PluginHandler.js ---
@@ -123,24 +123,27 @@ var handlers = {
throw new CordovaError('<asset> tag without required
"target" attribute');
}
- var www = options.usePlatformWww ? project.platformWww :
project.www;
- copyFile(plugin.dir, obj.src, www, obj.target);
+ copyFile(plugin.dir, obj.src, project.www, obj.target);
+ if (options && options.usePlatformWww) copyFile(plugin.dir,
obj.src, project.platformWww, obj.target);
},
uninstall:function(obj, plugin, project, options) {
var target = obj.target || obj.src;
if (!target) throw new CordovaError('<asset> tag without
required "target" attribute');
- var www = options.usePlatformWww ? project.platformWww :
project.www;
- removeFile(www, target);
- shell.rm('-Rf', path.resolve(www, 'plugins', plugin.id));
+ removeFile(project.www, target);
+ removeFile(project.www, path.join('plugins', plugin.id));
+ if (options && options.usePlatformWww) {
+ removeFile(project.platformWww, target);
+ removeFile(project.platformWww, path.join('plugins',
plugin.id));
+ }
}
},
'js-module': {
install: function (obj, plugin, project, options) {
// Copy the plugin's files into the www directory.
var moduleSource = path.resolve(plugin.dir, obj.src);
- var moduleName = plugin.id + '.' + (obj.name ||
path.parse(obj.src).name);
+ var moduleName = plugin.id + '.' + (obj.name ||
path.basename(obj.src, path.extname (obj.src)));
--- End diff --
Yup, these are the same, but `path.parse` is not available in Node v0.10
> Adding plugins prepares platforms, which is redundant and slow
> --------------------------------------------------------------
>
> Key: CB-11022
> URL: https://issues.apache.org/jira/browse/CB-11022
> Project: Apache Cordova
> Issue Type: Bug
> Components: CordovaLib
> Reporter: Jason Ginchereau
> Assignee: Vladimir Kotikov
> Labels: triaged
>
> For CB-9617, a change was made to automatically do a 'cordova prepare'
> operation after adding every plugin. As part of the prepare, all the files
> from the project's www directory are re-copied into the platform_www
> directory. For a large project with lots of source files, images, and other
> resources, this copy operation is potentially time-consuming. And it is
> redundant and unnecessary when adding a plugin, because those files do not
> need to be changed when adding a plugin.
> For a large project with many plugins, this slow redundant operation is
> repeated for every plugin, making the first-time build (installing all the
> plugins) take a very long time. As an extreme case, a customer reported their
> large project (35 plugins, ~150 MB in www) takes about 2 hours to build the
> first time. Most of that time is spent repeatedly preparing the platforms
> after adding each plugin. The log line that appears to be slow says it is
> "Generating config.xml from defaults for platform <platform>", but what it is
> actually doing is redundantly copying lots of files from www.
> This issue can also be observed at a smaller scale when building the Cordova
> mobilespec project, which contains tests for all the core 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]