[jira] [Commented] (CB-11951) Plugin preference default value is not being saved to .json

2016-10-12 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-11951:
-

GitHub user matrosov-nikita opened a pull request:

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

CB-11951 CB-11990 CB-11967: Respect preference default values when install 
plugin



### What does this PR do?
Respects preference default values when install plugin

### What testing has been done on this change?
Auto test

### Checklist
- [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) 
in the JIRA database
- [x] Commit message follows the format: "CB-3232: (android) Fix bug with 
resolving file paths", where CB- is the JIRA ID & "android" is the platform 
affected.
- [x] Added automated test coverage as appropriate for this change.



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

$ git pull https://github.com/matrosov-nikita/cordova-lib CB-11951

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

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


commit 51e171a4a3802fe693de4603a08a3584e302e19c
Author: Nikita Matrosov 
Date:   2016-10-12T10:39:35Z

CB-11951 CB-11990 CB-11967: Respect preference default values when install 
plugin




> Plugin preference default value is not being saved to .json
> -
>
> Key: CB-11951
> URL: https://issues.apache.org/jira/browse/CB-11951
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: CLI, CordovaLib
>Affects Versions: 6.3.1
> Environment: Windows 10 with anniversary update
>Reporter: Alexander Sorokin
>
> Plugin preference default value is not being saved to .json
> {noformat}
> cordova create foo
> cd foo
> cordova platform add android
> cordova plugin add cordova-plugin-ms-azure-mobile-engagement --variable 
> AZME_ANDROID_CONNECTION_STRING=Endpoint=0;AppId=0;SdkKey=0 --variable 
> AZME_ENABLE_PLUGIN_LOG=false
> {noformat}
> check out `./platforms/android/android.json` or `./pluguns/android.json`
> it has the following lines:
> {code}
> "installed_plugins": {
> <...>
> "cordova-plugin-ms-azure-mobile-engagement": {
> "AZME_ENABLE_PLUGIN_LOG": "false",
> "AZME_ANDROID_GOOGLE_PROJECT_NUMBER": "null",
> "AZME_ANDROID_REACH_ICON": "icon",
> "AZME_ANDROID_CONNECTION_STRING": "Endpoint=0;AppId=0;SdkKey=0",
> "PACKAGE_NAME": "io.cordova.hellocordova"
> }
> },
> {code}
> You can see that "AZME_ENABLE_PLUGIN_LOG" is saved here, while 
> "AZME_ENABLE_NATIVE_LOG" is not.
> They both can be found in the plugin section of the  plugin's `plugin.xml` 
> file:
> https://github.com/Azure/azure-mobile-engagement-cordova/blob/master/plugin.xml#L29
> Note that the Android-specific preferences have been saved correctly.
> cordova@6.3.0 doesn't have this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-11951) Plugin preference default value is not being saved to .json

2016-10-12 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-11951:
-

Github user codecov-io commented on the issue:

https://github.com/apache/cordova-lib/pull/501
  
## [Current 
coverage](https://codecov.io/gh/apache/cordova-lib/pull/501?src=pr) is 80.40% 
(diff: 100%)
> Merging [#501](https://codecov.io/gh/apache/cordova-lib/pull/501?src=pr) 
into [master](https://codecov.io/gh/apache/cordova-lib/branch/master?src=pr) 
will not change coverage

```diff
@@ master   #501   diff @@
==
  Files67 67  
  Lines  5189   5189  
  Methods 836836  
  Messages  0  0  
  Branches   1005   1005  
==
  Hits   4172   4172  
  Misses 1017   1017  
  Partials  0  0  
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update 
[c44db3d...51e171a](https://codecov.io/gh/apache/cordova-lib/compare/c44db3d7a00779d5c7eb5ae6150847156858a4f7...51e171a4a3802fe693de4603a08a3584e302e19c?src=pr)


> Plugin preference default value is not being saved to .json
> -
>
> Key: CB-11951
> URL: https://issues.apache.org/jira/browse/CB-11951
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: CLI, CordovaLib
>Affects Versions: 6.3.1
> Environment: Windows 10 with anniversary update
>Reporter: Alexander Sorokin
>Assignee: Nikita Matrosov
>
> Plugin preference default value is not being saved to .json
> {noformat}
> cordova create foo
> cd foo
> cordova platform add android
> cordova plugin add cordova-plugin-ms-azure-mobile-engagement --variable 
> AZME_ANDROID_CONNECTION_STRING=Endpoint=0;AppId=0;SdkKey=0 --variable 
> AZME_ENABLE_PLUGIN_LOG=false
> {noformat}
> check out `./platforms/android/android.json` or `./pluguns/android.json`
> it has the following lines:
> {code}
> "installed_plugins": {
> <...>
> "cordova-plugin-ms-azure-mobile-engagement": {
> "AZME_ENABLE_PLUGIN_LOG": "false",
> "AZME_ANDROID_GOOGLE_PROJECT_NUMBER": "null",
> "AZME_ANDROID_REACH_ICON": "icon",
> "AZME_ANDROID_CONNECTION_STRING": "Endpoint=0;AppId=0;SdkKey=0",
> "PACKAGE_NAME": "io.cordova.hellocordova"
> }
> },
> {code}
> You can see that "AZME_ENABLE_PLUGIN_LOG" is saved here, while 
> "AZME_ENABLE_NATIVE_LOG" is not.
> They both can be found in the plugin section of the  plugin's `plugin.xml` 
> file:
> https://github.com/Azure/azure-mobile-engagement-cordova/blob/master/plugin.xml#L29
> Note that the Android-specific preferences have been saved correctly.
> cordova@6.3.0 doesn't have this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-11951) Plugin preference default value is not being saved to .json

2016-10-13 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-11951:
-

Github user stevengill commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/501#discussion_r83341216
  
--- Diff: cordova-lib/spec-cordova/plugin.spec.js ---
@@ -203,6 +204,23 @@ describe('plugin end-to-end', function() {
 .fin(done);
 });
 
+it('should respect preference default values', function (done) {
+   addPlugin(path.join(pluginsDir, org_test_defaultvariables), 
org_test_defaultvariables, {cli_variables: { REQUIRED:'NO', 
REQUIRED_ANDROID:'NO'}}, done)
+   .then(function() {
+var platformJsonPath = path.join(project, 'plugins', 
helpers.testPlatform + '.json');
+var installed_plugins = 
JSON.parse(fs.readFileSync(platformJsonPath)).installed_plugins;
--- End diff --

Instead of `JSON.parse` & `fs.readFileSync`, why not use 
```var installed_plugins = require('platformJsonPath').installed_plugins;```

That would remove the need to `require('fs')`


> Plugin preference default value is not being saved to .json
> -
>
> Key: CB-11951
> URL: https://issues.apache.org/jira/browse/CB-11951
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: CLI, CordovaLib
>Affects Versions: 6.3.1
> Environment: Windows 10 with anniversary update
>Reporter: Alexander Sorokin
>Assignee: Nikita Matrosov
>
> Plugin preference default value is not being saved to .json
> {noformat}
> cordova create foo
> cd foo
> cordova platform add android
> cordova plugin add cordova-plugin-ms-azure-mobile-engagement --variable 
> AZME_ANDROID_CONNECTION_STRING=Endpoint=0;AppId=0;SdkKey=0 --variable 
> AZME_ENABLE_PLUGIN_LOG=false
> {noformat}
> check out `./platforms/android/android.json` or `./pluguns/android.json`
> it has the following lines:
> {code}
> "installed_plugins": {
> <...>
> "cordova-plugin-ms-azure-mobile-engagement": {
> "AZME_ENABLE_PLUGIN_LOG": "false",
> "AZME_ANDROID_GOOGLE_PROJECT_NUMBER": "null",
> "AZME_ANDROID_REACH_ICON": "icon",
> "AZME_ANDROID_CONNECTION_STRING": "Endpoint=0;AppId=0;SdkKey=0",
> "PACKAGE_NAME": "io.cordova.hellocordova"
> }
> },
> {code}
> You can see that "AZME_ENABLE_PLUGIN_LOG" is saved here, while 
> "AZME_ENABLE_NATIVE_LOG" is not.
> They both can be found in the plugin section of the  plugin's `plugin.xml` 
> file:
> https://github.com/Azure/azure-mobile-engagement-cordova/blob/master/plugin.xml#L29
> Note that the Android-specific preferences have been saved correctly.
> cordova@6.3.0 doesn't have this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-11951) Plugin preference default value is not being saved to .json

2016-10-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-11951:
-

Github user matrosov-nikita commented on the issue:

https://github.com/apache/cordova-lib/pull/501
  
@stevengill, thanks, updated.


> Plugin preference default value is not being saved to .json
> -
>
> Key: CB-11951
> URL: https://issues.apache.org/jira/browse/CB-11951
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: CLI, CordovaLib
>Affects Versions: 6.3.1
> Environment: Windows 10 with anniversary update
>Reporter: Alexander Sorokin
>Assignee: Nikita Matrosov
>
> Plugin preference default value is not being saved to .json
> {noformat}
> cordova create foo
> cd foo
> cordova platform add android
> cordova plugin add cordova-plugin-ms-azure-mobile-engagement --variable 
> AZME_ANDROID_CONNECTION_STRING=Endpoint=0;AppId=0;SdkKey=0 --variable 
> AZME_ENABLE_PLUGIN_LOG=false
> {noformat}
> check out `./platforms/android/android.json` or `./pluguns/android.json`
> it has the following lines:
> {code}
> "installed_plugins": {
> <...>
> "cordova-plugin-ms-azure-mobile-engagement": {
> "AZME_ENABLE_PLUGIN_LOG": "false",
> "AZME_ANDROID_GOOGLE_PROJECT_NUMBER": "null",
> "AZME_ANDROID_REACH_ICON": "icon",
> "AZME_ANDROID_CONNECTION_STRING": "Endpoint=0;AppId=0;SdkKey=0",
> "PACKAGE_NAME": "io.cordova.hellocordova"
> }
> },
> {code}
> You can see that "AZME_ENABLE_PLUGIN_LOG" is saved here, while 
> "AZME_ENABLE_NATIVE_LOG" is not.
> They both can be found in the plugin section of the  plugin's `plugin.xml` 
> file:
> https://github.com/Azure/azure-mobile-engagement-cordova/blob/master/plugin.xml#L29
> Note that the Android-specific preferences have been saved correctly.
> cordova@6.3.0 doesn't have this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-11951) Plugin preference default value is not being saved to .json

2016-10-14 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CB-11951:
--

Commit afcffc59ad186ae98518ac890fd942d3ca7069d8 in cordova-lib's branch 
refs/heads/master from [~Nikita Matrosov]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-lib.git;h=afcffc5 ]

CB-11951 CB-11967: Respect preference default values when install plugin


> Plugin preference default value is not being saved to .json
> -
>
> Key: CB-11951
> URL: https://issues.apache.org/jira/browse/CB-11951
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: CLI, CordovaLib
>Affects Versions: 6.3.1
> Environment: Windows 10 with anniversary update
>Reporter: Alexander Sorokin
>Assignee: Nikita Matrosov
>
> Plugin preference default value is not being saved to .json
> {noformat}
> cordova create foo
> cd foo
> cordova platform add android
> cordova plugin add cordova-plugin-ms-azure-mobile-engagement --variable 
> AZME_ANDROID_CONNECTION_STRING=Endpoint=0;AppId=0;SdkKey=0 --variable 
> AZME_ENABLE_PLUGIN_LOG=false
> {noformat}
> check out `./platforms/android/android.json` or `./pluguns/android.json`
> it has the following lines:
> {code}
> "installed_plugins": {
> <...>
> "cordova-plugin-ms-azure-mobile-engagement": {
> "AZME_ENABLE_PLUGIN_LOG": "false",
> "AZME_ANDROID_GOOGLE_PROJECT_NUMBER": "null",
> "AZME_ANDROID_REACH_ICON": "icon",
> "AZME_ANDROID_CONNECTION_STRING": "Endpoint=0;AppId=0;SdkKey=0",
> "PACKAGE_NAME": "io.cordova.hellocordova"
> }
> },
> {code}
> You can see that "AZME_ENABLE_PLUGIN_LOG" is saved here, while 
> "AZME_ENABLE_NATIVE_LOG" is not.
> They both can be found in the plugin section of the  plugin's `plugin.xml` 
> file:
> https://github.com/Azure/azure-mobile-engagement-cordova/blob/master/plugin.xml#L29
> Note that the Android-specific preferences have been saved correctly.
> cordova@6.3.0 doesn't have this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-11951) Plugin preference default value is not being saved to .json

2016-10-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-11951:
-

Github user asfgit closed the pull request at:

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


> Plugin preference default value is not being saved to .json
> -
>
> Key: CB-11951
> URL: https://issues.apache.org/jira/browse/CB-11951
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: CLI, CordovaLib
>Affects Versions: 6.3.1
> Environment: Windows 10 with anniversary update
>Reporter: Alexander Sorokin
>Assignee: Nikita Matrosov
>
> Plugin preference default value is not being saved to .json
> {noformat}
> cordova create foo
> cd foo
> cordova platform add android
> cordova plugin add cordova-plugin-ms-azure-mobile-engagement --variable 
> AZME_ANDROID_CONNECTION_STRING=Endpoint=0;AppId=0;SdkKey=0 --variable 
> AZME_ENABLE_PLUGIN_LOG=false
> {noformat}
> check out `./platforms/android/android.json` or `./pluguns/android.json`
> it has the following lines:
> {code}
> "installed_plugins": {
> <...>
> "cordova-plugin-ms-azure-mobile-engagement": {
> "AZME_ENABLE_PLUGIN_LOG": "false",
> "AZME_ANDROID_GOOGLE_PROJECT_NUMBER": "null",
> "AZME_ANDROID_REACH_ICON": "icon",
> "AZME_ANDROID_CONNECTION_STRING": "Endpoint=0;AppId=0;SdkKey=0",
> "PACKAGE_NAME": "io.cordova.hellocordova"
> }
> },
> {code}
> You can see that "AZME_ENABLE_PLUGIN_LOG" is saved here, while 
> "AZME_ENABLE_NATIVE_LOG" is not.
> They both can be found in the plugin section of the  plugin's `plugin.xml` 
> file:
> https://github.com/Azure/azure-mobile-engagement-cordova/blob/master/plugin.xml#L29
> Note that the Android-specific preferences have been saved correctly.
> cordova@6.3.0 doesn't have this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-11951) Plugin preference default value is not being saved to .json

2016-10-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-11951:
-

Github user stevengill commented on the issue:

https://github.com/apache/cordova-lib/pull/501
  
Thanks for the pr @matrosov-nikita! merged! Feel free to close the issues 
on jira now :D


> Plugin preference default value is not being saved to .json
> -
>
> Key: CB-11951
> URL: https://issues.apache.org/jira/browse/CB-11951
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: CLI, CordovaLib
>Affects Versions: 6.3.1
> Environment: Windows 10 with anniversary update
>Reporter: Alexander Sorokin
>Assignee: Nikita Matrosov
>
> Plugin preference default value is not being saved to .json
> {noformat}
> cordova create foo
> cd foo
> cordova platform add android
> cordova plugin add cordova-plugin-ms-azure-mobile-engagement --variable 
> AZME_ANDROID_CONNECTION_STRING=Endpoint=0;AppId=0;SdkKey=0 --variable 
> AZME_ENABLE_PLUGIN_LOG=false
> {noformat}
> check out `./platforms/android/android.json` or `./pluguns/android.json`
> it has the following lines:
> {code}
> "installed_plugins": {
> <...>
> "cordova-plugin-ms-azure-mobile-engagement": {
> "AZME_ENABLE_PLUGIN_LOG": "false",
> "AZME_ANDROID_GOOGLE_PROJECT_NUMBER": "null",
> "AZME_ANDROID_REACH_ICON": "icon",
> "AZME_ANDROID_CONNECTION_STRING": "Endpoint=0;AppId=0;SdkKey=0",
> "PACKAGE_NAME": "io.cordova.hellocordova"
> }
> },
> {code}
> You can see that "AZME_ENABLE_PLUGIN_LOG" is saved here, while 
> "AZME_ENABLE_NATIVE_LOG" is not.
> They both can be found in the plugin section of the  plugin's `plugin.xml` 
> file:
> https://github.com/Azure/azure-mobile-engagement-cordova/blob/master/plugin.xml#L29
> Note that the Android-specific preferences have been saved correctly.
> cordova@6.3.0 doesn't have this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org