[ 
https://issues.apache.org/jira/browse/CB-10328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Byoungro So updated CB-10328:
-----------------------------
    Description: 
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 [email protected]
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 [email protected]
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}

  was:
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 [email protected]
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 [email protected]
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
cordova-plugin-file 4.1.1 "File"
cordova-plugin-media 2.1.0 "Media"
cordova-plugin-whitelist 1.2.1 "Whitelist"
[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}


> 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 [email protected]
> 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 [email protected]
> 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}



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