Sebastien Lorber created CB-9607:
------------------------------------
Summary: Permits to override/customize config.xml settings with
CLI build/run commands
Key: CB-9607
URL: https://issues.apache.org/jira/browse/CB-9607
Project: Apache Cordova
Issue Type: Improvement
Components: CLI
Affects Versions: 5.1.1
Reporter: Sebastien Lorber
I'm using a Cordova plugin for Intercom.
Intercom is a SaaS service we use to track users.
They provide us 2 API keys, one for dev, and one for prod, because we don't
want to melt test users with real users.
I use the plugin with something like:
{code}
<plugin name="cordova-plugin-intercom" spec="1.0.8" >
<variable name="APP_ID" value="prodKey..." />
</plugin>
{code}
The problem is that currently, when I want to build the app for testing, I have
to manually edit the config.xml file everytime to change the prodKey to devKey,
and then relaunch cordova build android
I have seen the platform options attributes of the build command (not really
documented, a bit mentionned here CB-6024), but it does not seem to be what I
look for.
Some suggestions for a solution:
{code}
<plugin name="cordova-plugin-intercom" spec="1.0.8" >
<variable name="APP_ID" value="$INTERCOM_API_KEY:defaultValue" />
</plugin>
{code}
cordova build android -> will use "defaultValue"
cordova build android --INTERCOM_API_KEY="overrideValue" -> will use
"overrideValue"
Another idea:
{code}
<plugin name="cordova-plugin-intercom" spec="1.0.8" >
<variable name="APP_ID" debugValue="devKey" releaseValue="prodKey" />
</plugin>
{code}
cordova build android --debug -> will use "devKey"
cordova build android -- release -> will use "prodKey"
----------------------------
See also: https://github.com/intercom/intercom-cordova/issues/1
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]