GitHub user ktop opened a pull request:
https://github.com/apache/cordova-lib/pull/449
CB-11023 Add edit-config functionality
New edit-config tag for plugin.xml will allow users to modify xml
attributes.
Ex. Assumes your AndroidManifest.xml has a second activity element with
attribute android:name="SecondActivity"
```xml
<!-- Will modify first activity -->
<edit-config file="AndroidManifest.xml"
target="/manifest/application/activity" mode="merge">
<activity android:enabled="true"
android:configChanges="orientation|keyboardHidden" />
</edit-config>
<!-- Will modify second activity -->
<edit-config file="AndroidManifest.xml"
target="/manifest/application/activity[@android:name='SecondActivity']"
mode="overwrite">
<activity android:enabled="true" android:name="SecondActivity"
/>
</edit-config>
```
file: specifies the file location
target: specifies an xpath to the element that you want to modify
modes:
- merge: add attributes in the target with the ones specified by
edit-config and will replace if the attribute names are the same
- overwrite: replace all of the attributes at the target with the one
specified by edit-config
children: will only modify one element per edit-config tag
There is conflict checking now....if a plugin wants to modify an attribute
another plugin has already modified, an error will be thrown and plugin install
will fail. The user must fix the conflict or they can use --force to force add
the plugin and overwrite the conflict.
Lastly, on plugin uninstall, the plugin should restore the attributes to
the state it was before installing.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ktop/cordova-lib editconfig
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-lib/pull/449.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 #449
----
commit a3864929400f61fc31d03c3bab1d91a9467a3fbf
Author: unknown <[email protected]>
Date: 2016-05-26T21:36:23Z
CB-11023 Add edit-config functionality
----
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]