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

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

Github user macdonst commented on the pull request:

    https://github.com/apache/cordova-lib/pull/432#issuecomment-215811240
  
    @ktop Yeah, I have the `attr="true"` in my plugin.xml and it still gets 
added instead of merged.
    
    ```
    <config-file target="AndroidManifest.xml" parent="/manifest" attr="true">
        <application android:name="MyApplication" android:isGame="true" />
        <uses-sdk android:maxSdkVersion="22" />
    </config-file>
    ```
    
    I'm not sure why it's not working for me 😢 
    
    Regardless, I have some other comments. What if I put config-file 
statements in config.xml? Which change takes precedence?
    
    Also, instead of using `attr="true"` would it make more sense to use a more 
granular approach like `mode="add|replace|merge|delete"` where:
    
    - add will append to the inner xml of the parent
    - replace will completely overwrite the parent's inner xml with your 
declaration
    - merge will attempt to find elements of the same name and merge their 
attributes
    - delete will search for elements matching the specified name and 
attributes and delete them


> plugin.xml should be able to add attribute to an existing element in 
> AndroidManifest.xml
> ----------------------------------------------------------------------------------------
>
>                 Key: CB-11023
>                 URL: https://issues.apache.org/jira/browse/CB-11023
>             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
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to