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-11023) plugin.xml should be able to add attribute to an existing element in AndroidManifest.xml
Date Fri, 03 Jun 2016 20:42:59 GMT


ASF GitHub Bot commented on CB-11023:

GitHub user ktop opened a pull request:

    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"
    <!-- Will modify first activity -->
    <edit-config file="AndroidManifest.xml" target="/manifest/application/activity" mode="merge">
                <activity android:enabled="true" android:configChanges="orientation|keyboardHidden"
    <!-- Will modify second activity -->
    <edit-config file="AndroidManifest.xml" target="/manifest/application/activity[@android:name='SecondActivity']"
                <activity android:enabled="true" android:name="SecondActivity" />
    file: specifies the file location
    target: specifies an xpath to the element that you want to modify
    - 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 editconfig

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

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 <>
Date:   2016-05-26T21:36:23Z

    CB-11023 Add edit-config functionality


> plugin.xml should be able to add attribute to an existing element in AndroidManifest.xml
> ----------------------------------------------------------------------------------------
>                 Key: CB-11023
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: CLI, Plugman
>            Reporter: Carlos Santana
> We have a need for a plugin we develop to add the attribute android:name to the <application>
element to be able to point to a Class that tracks app sessions for analytics.
> plugin.xml only support via <config-file> only to add elements to AndroidManfist.xml
this request is to add an enhancement to also handle adding an attribute to an existing element.

This message was sent by Atlassian JIRA

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

View raw message