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

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

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

    https://github.com/apache/cordova-lib/pull/247#discussion_r32479018
  
    --- Diff: cordova-lib/src/cordova/plugin.js ---
    @@ -168,10 +168,19 @@ module.exports = function plugin(command, targets, 
opts) {
                         })
                         .then(function(dir) {
                             // Validate top-level required variables
    -                        var pluginVariables = 
pluginInfoProvider.get(dir).getPreferences(),
    -                            missingVariables = 
pluginVariables.filter(function (v) {
    +                        var pluginVariables = 
pluginInfoProvider.get(dir).getPreferences();
    +                        var requiredVariables = [];
    +                        for(var i in pluginVariables)
    +                        {
    +                            var v = pluginVariables[i];
    +                            // discard variables with default value
    +                            if (!v.default)
    --- End diff --
    
    Have a look in `spec-cordova/plugin.spec.js`. You should be able to add 
something there. Create a `plugin.xml` with the required bits and add it under 
`spec-cordova/fixtures/plugins`.


> Plugin Variables should support a default value
> -----------------------------------------------
>
>                 Key: CB-9162
>                 URL: https://issues.apache.org/jira/browse/CB-9162
>             Project: Apache Cordova
>          Issue Type: Improvement
>            Reporter: Olivier Goguel
>
> When declaring a variable, it is possible to make it mandatory (by using the 
> <preference> tag), but there's no way to make it optional by defining a 
> default value.
> For example: <preference value="ENABLE_LOG" default="true" />
> This would allow users to keep on customizing specific features of the 
> plugins while not having to worry about all the variables.



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

Reply via email to