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-9162) Plugin Variables should support a default value
Date Sat, 25 Jul 2015 11:58:05 GMT


ASF GitHub Bot commented on CB-9162:

Github user TimBarham commented on a diff in the pull request:
    --- Diff: cordova-lib/spec-plugman/plugins/org.test.defaultvariables/plugin.xml ---
    @@ -0,0 +1,16 @@
    +<?xml version="1.0" encoding="UTF-8"?>
    +<plugin xmlns=""
    +    xmlns:android=""
    +    id="org.test.defaultvariables"
    +    version="3.0.0">
    +    <name>Use Default Variables</name>
    +    <!-- android -->
    +    <platform name="android">
    +            <preference name="ENABLE_LOG" default="yes" />
    +            <preference name="API_KEY" />
    +    </platform>
    --- End diff --
    If you are creating a plugin, and need to use variables because some values will need
to be defined by the app developer, you *use* the variable by including a reference to it
in values in your plugin's `plugin.xml`. The value of the variable (whether the default value
specified in the `preference` element, or a value supplied by the app developer when the plugin
is added to their project) is substituted for references to the variable in values in `plugin.xml`
when those values are used. See [here](
for some more info.

> Plugin Variables should support a default value
> -----------------------------------------------
>                 Key: CB-9162
>                 URL:
>             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

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

View raw message