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

ASF GitHub Bot commented on CB-8651:
------------------------------------

GitHub user TimBarham opened a pull request:

    https://github.com/apache/cordova-lib/pull/196

    CB-8651 Restoring platforms causes plugin install to be triggered twice.

    If you add a platform and there are plugins listed in `config.xml`, those 
plugins get added twice. Once during `prepare()`, when we add all plugins 
listed in `config.xml`, and once in `platform.add()`, when we add all installed 
plugins to the new platform.
    
    Both these cases are needed in different scenarios, so the easiest fix 
seemed to be to check for and ignore plugins that have already been installed 
for a platform, in `installPluginsForNewPlatform()`.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MSOpenTech/cordova-lib CB-8651

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-lib/pull/196.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 #196
    
----
commit defba38ed74f4af4ed25aeee80baeaf77f42e4ee
Author: Tim Barham <[email protected]>
Date:   2015-03-27T13:45:15Z

    CB-8651 Restoring platforms causes plugin install to be triggered twice.
    
    If you add a platform and there are plugins listed in config.xml, those 
plugins get added twice. One during prepare(), when we add all plugins listed 
in config.xml, and once in platform.add(), when we add all installed plugins to 
the new platform.
    
    Both these cases are needed in different scenarios, so the easiest fix 
seemed to be to check for and ignore plugins that have already been installed 
for a platform, in installPluginsForNewPlatform().

----


> Restoring platforms and plugins causes plugin install to be triggered twice
> ---------------------------------------------------------------------------
>
>                 Key: CB-8651
>                 URL: https://issues.apache.org/jira/browse/CB-8651
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaLib
>            Reporter: Connor Pearson
>            Assignee: Tim Barham
>            Priority: Minor
>
> Using the basic starter app with the following config.xml:
> {code:xml}
> <?xml version='1.0' encoding='utf-8'?>
> <widget id="io.cordova.hellocordova" version="0.0.1" 
> xmlns="http://www.w3.org/ns/widgets"; 
> xmlns:cdv="http://cordova.apache.org/ns/1.0";>
>     <name>HelloCordova</name>
>     <content src="index.html" />
>     <access origin="*" />
>     <engine name="ios" version="3.8.0" />
>     <feature name="Device">
>         <param name="id" value="org.apache.cordova.device" />
>     </feature>
> </widget>
> {code}
> Running cordova prepare ios without a platforms or plugins directory produces 
> this output:
> {quote}
> Restoring platform [email protected] referenced on config.xml
> Adding ios project...
> iOS project created with [email protected]
> Discovered org.apache.cordova.device in config.xml. Installing to the project
> Fetching plugin "org.apache.cordova.device" via plugin registry
> Installing "org.apache.cordova.device" for ios
> Plugin "org.apache.cordova.device" already installed on ios.
> {quote}
> It looks like Cordova is trying to install the plugin twice.



--
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