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/02/28 17:08:18 UTC

[jira] [Commented] (CB-10328) dependency plugins are not removed even if not top-level

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

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

GitHub user bso-intel opened a pull request:

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

    CB-10328 set top-level property of plugins when adding new platforms

    The problem is caused by not setting the top-level property of plugins from cordova/platform.js-installPluginsForNewPlatform() function and by always setting is_top_level to true in plugman/install.js-installPlugin.
    This caused all plugins that exist in the plugins directory to be set top-level in plugins/<platform>.json files.
    The uninstallation process relies on this metadata file to see if there is any dependency plugin was installed when removing a top-level plugin.
    By setting the top-level correctly in <platform>.json files, this uninstallation process worked correctly.


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

    $ git pull https://github.com/bso-intel/cordova-lib CB-10328

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

    https://github.com/apache/cordova-lib/pull/402.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 #402
    
----
commit c7b3f4e5ce74c4cf79c14fa8239ad7a7cc07ebfe
Author: Byoungro So <by...@intel.com>
Date:   2016-02-28T15:59:49Z

    CB-10328 set top-level property of plugins when adding new platforms

----


> dependency plugins are not removed even if not top-level
> --------------------------------------------------------
>
>                 Key: CB-10328
>                 URL: https://issues.apache.org/jira/browse/CB-10328
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaLib
>            Reporter: Byoungro So
>            Assignee: Byoungro So
>              Labels: triaged
>
> Some plugins fetch and install dependency plugins.
> These dependency plugins should be removed when the top-level depender plugin is removed.
> However, this is not happening.
> For example, cordova-plugin-media brings cordova-plugin-file as a dependency.
> When, cordova-plugin-media is removed cordova-plugin-file should be removed together.
> I figured that this is caused by resetting the top-level property of plugins when adding a new platform.
> Here is how to reproduce the bug.
> {code}
> [test] cordova create test
> Creating a new cordova project.
> [test] cd test
> [test] cordova plugin add cordova-plugin-media
> Fetching plugin "cordova-plugin-media@~2.1.0" via npm
> [test] cordova platform add ios
> Adding ios project...
> iOS project created with cordova-ios@4.0.1
> Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the project
> Fetching plugin "cordova-plugin-whitelist@1" via npm
> Installing "cordova-plugin-whitelist" for ios
> Installing "cordova-plugin-media" for ios
> Fetching plugin "cordova-plugin-file" via npm
> Installing "cordova-plugin-file" for ios
> [test] cordova plugin
> cordova-plugin-file 4.1.1 "File"
> cordova-plugin-media 2.1.0 "Media"
> cordova-plugin-whitelist 1.2.1 "Whitelist"
> [test] cordova platform add android
> Adding android project...
> Creating Cordova project for the Android platform:
> 	Path: platforms/android
> 	Package: io.cordova.hellocordova
> 	Name: HelloCordova
> 	Activity: MainActivity
> 	Android target: android-23
> Android project created with cordova-android@5.1.0
> Installing "cordova-plugin-file" for android
> Installing "cordova-plugin-media" for android
> Dependent plugin "cordova-plugin-file" already installed on android.
> Installing "cordova-plugin-whitelist" for android
>                This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
> [test] cordova plugin rm cordova-plugin-media
> Uninstalling cordova-plugin-media from android
> Uninstalling 1 dependent plugins.
> Uninstalling cordova-plugin-file from ios
> Uninstalling cordova-plugin-media from ios
> Removing "cordova-plugin-media"
> [test] cordova plugin
> cordova-plugin-file 4.1.1 "File"
> cordova-plugin-whitelist 1.2.1 "Whitelist"
> {code}
> If you see the following error when adding the ios platform, I already fixed that issue in CB-10659.
> {code}
> Failed to install 'cordova-plugin-whitelist':Error: ENOENT, no such file or directory '/Users/bso/cordova/test/temp/platforms/ios/HelloCordova.xcodeproj/project.pbxproj'
> {code}
> You don't need to use ios to reproduce this issue. Use windows instead if you can't add ios.



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