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

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

Github user ktop commented on the pull request:

    https://github.com/apache/cordova-lib/pull/432#issuecomment-220647997
  
    I'd like to clear up some confusion I have on adding attributes. 
    Before, we had decided on going with this syntax where the child elements 
of config-file tag would point to the child tags of the parent we want to add 
attributes to, so that we could add attributes to more than one child in a 
single config-file tag.
    
    With the following syntax, I wouldn't be able to at add to the second 
activity. 
    ```xml
    <config-file target="AndroidManifest.xml" parent="/manifest/application" 
mode="merge" >
        <activity android:enabled="true" />
    </config-file>
    ```
    
    Now with your suggestion, the tag would look like this:
    Here, I would be able to specify the second activity, but this contradicts 
with what we had before since activity tag isn't a child of the parent. 
    ```xml
    <config-file target="AndroidManifest.xml" 
parent="/manifest/application/activity[@android:name='SecondActivity']" 
mode="merge" >
        <activity android:enabled="true" />
    </config-file>
    ```
    
    Would we lose the ability to add attributes to more than one child? Or 
should we try to do both? Detect that we want to add to the tag that is the 
same as the parent as well as child tags. (Not sure if this makes sense)
    ```xml
    <config-file target="AndroidManifest.xml" 
parent="/manifest/application/activity[@android:name='SecondActivity']" 
mode="merge" >
        <activity android:enabled="true" />
        <intent-filter android:priority="1" />
    </config-file>
    ```
    Or any other ideas?


> 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