cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CB-10328) dependency plugins are not removed even if not top-level
Date Thu, 03 Mar 2016 16:16:18 GMT


ASF GitHub Bot commented on CB-10328:

Github user bso-intel commented on a diff in the pull request:
    --- Diff: cordova-lib/src/plugman/install.js ---
    @@ -71,7 +71,8 @@ module.exports = function installPlugin(platform, project_dir, id, plugins_dir,
         project_dir = cordovaUtil.convertToRealPathSafe(project_dir);
         plugins_dir = cordovaUtil.convertToRealPathSafe(plugins_dir);
         options = options || {};
    -    options.is_top_level = true;
    +    if (options.is_top_level === undefined)
    --- End diff --
    I changed as you suggested.
    Do you mean you want to set options.is_top_level = true if options.is_top_level is set
to null ?
    In fact, the is_top_level is a boolean property, so a null value for this property is
a bug although null is falsy in Javascript.
    When options.is_top_level is set to null for some reason, options.hasOwnProperty('is_top_level')
is  true.
    That means, the new condition (options.hasOwnProperty('is_top_level') === false) will
not change options.is_top_level from the null value to true.
    Just wanted clarify.

> dependency plugins are not removed even if not top-level
> --------------------------------------------------------
>                 Key: CB-10328
>                 URL:
>             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
> {code}
> You don't need to use ios to reproduce this issue. Use windows instead if you can't add

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message