You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/04/08 14:11:25 UTC
[jira] [Commented] (CB-11022) Adding plugins prepares platforms,
which is redundant and slow
[ https://issues.apache.org/jira/browse/CB-11022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15232098#comment-15232098 ]
ASF GitHub Bot commented on CB-11022:
-------------------------------------
GitHub user vladimir-kotikov opened a pull request:
https://github.com/apache/cordova-lib/pull/423
CB-11022 Improve performance of `cordova plugin add` command
This addresses [CB-11022](https://issues.apache.org/jira/browse/CB-11022) and dramaticaly reduces time required for plugin installation (especially for the projects with a lot of www assets) by skipping prepare after each plugin install.
This change also requires a corresponding update for the platforms that implement PlatformApi contract - they have to take care of installing (or removing) their js and www files into both `www` and `platform_www` directories and return any non-falsy value as a result of `addPlugin`/`removePlugin` methods
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/MSOpenTech/cordova-lib CB-11022
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-lib/pull/423.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #423
----
commit 161e5fd0f1ba3fe88ad74b1bd30182f91d7b8550
Author: Vladimir Kotikov <v-...@microsoft.com>
Date: 2016-04-07T10:56:49Z
CB-11022 Respect result returned by plugin installation and skip prepare if it is truthy
----
> 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
>
> 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: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org