You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by bso-intel <gi...@git.apache.org> on 2016/02/28 17:07:26 UTC

[GitHub] cordova-lib pull request: CB-10328 set top-level property of plugi...

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

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib pull request: CB-10328 set top-level property of plugi...

Posted by bso-intel <gi...@git.apache.org>.
Github user bso-intel commented on the pull request:

    https://github.com/apache/cordova-lib/pull/402#issuecomment-191536082
  
    @vladimir-kotikov 
    Could you review this pull request?
    Thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib pull request: CB-10328 set top-level property of plugi...

Posted by bso-intel <gi...@git.apache.org>.
Github user bso-intel commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/402#discussion_r54902889
  
    --- 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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib pull request: CB-10328 set top-level property of plugi...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/402#discussion_r55119960
  
    --- 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 meant that IMO the purpose of this check is to validate id someone already specified this value, and in this case it's beter to use `hasOwnProperty` which does exactly what it means


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib pull request: CB-10328 set top-level property of plugi...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/402#discussion_r54849930
  
    --- 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 --
    
    Maybe use `options.hasOwnProperty`? What if it's set to `null` for example?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib pull request: CB-10328 set top-level property of plugi...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on the pull request:

    https://github.com/apache/cordova-lib/pull/402#issuecomment-191657982
  
    @bso-intel, LGTM apart from one comment. It also would be great if you add a test for this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib pull request: CB-10328 set top-level property of plugi...

Posted by bso-intel <gi...@git.apache.org>.
Github user bso-intel commented on the pull request:

    https://github.com/apache/cordova-lib/pull/402#issuecomment-192555588
  
    @vladimir-kotikov ,
    I added an e2e test that is described in CB-10328.
    The test fails without my fix, and passes with my fix.
    Could you merge this pull request?
    Thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib pull request: CB-10328 set top-level property of plugi...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib pull request: CB-10328 set top-level property of plugi...

Posted by bso-intel <gi...@git.apache.org>.
Github user bso-intel commented on the pull request:

    https://github.com/apache/cordova-lib/pull/402#issuecomment-192706126
  
    Thanks for merging, @vladimir-kotikov 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org