GitHub user rs22 opened a pull request:

    https://github.com/apache/cordova-windows/pull/186

    Fix duplicate capability declarations in Win10 AppxManifest

    I have created an issue for this in Jira: 
https://issues.apache.org/jira/browse/CB-11582
    
    Let me describe the issue in more detail - I have this 
.\testplugin\plugin.xml:
    ```
    <?xml version='1.0' encoding='utf-8'?>
    <plugin id="testplugin" version="1" 
xmlns="http://apache.org/cordova/ns/plugins/1.0";>
        <name>testplugin</name>
        
        <platform name="windows">
            <config-file parent="/Package/Capabilities" 
target="package.windows10.appxmanifest">
                <Capability Name="enterpriseAuthentication" />
                <Capability Name="sharedUserCertificates" />
            </config-file>
        </platform>
    </plugin>
    ```
    
    When I run `cordova create app && pushd app && cordova plugin add 
..\testplugin && cordova platform add windows` the 
package.windows10.appxmanifest will have the capabilities set correctly. Now, 
everytime I run `cordova prepare`, this will duplicate all the uap-prefixed 
capabilities:
    
    ```
        <Capabilities>
            <Capability Name="internetClient" />
            <uap:Capability Name="enterpriseAuthentication" />
            <uap:Capability Name="sharedUserCertificates" />
            <uap:Capability Name="enterpriseAuthentication" />
            <uap:Capability Name="sharedUserCertificates" />
        </Capabilities>
    ```
    
    I had a look at how the capability declarations are handled in 
ConfigChanges.js and AppxManifest.js. The easiest fix seems to be to just check 
for duplicated capabilities when writing the AppxManifest (which is what I've 
implemented). Another way could be to inject the uap prefixes before applying 
the ConfigChanges, so that the capabilities are not being duplicated in the 
first place.
    
    Let me know what you think and I'll update the code accordingly.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rs22/cordova-windows master

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

    https://github.com/apache/cordova-windows/pull/186.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 #186
    
----
commit 1e7d3fcf6b6c85dad8b4e1ecd7b9a2739f5e0522
Author: Robert Schmid <r.sch...@outlook.com>
Date:   2016-07-14T21:50:56Z

    Remove duplicate capabilities when writing the AppxManifest

----


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to