Quantcast
Channel: MSBuild Extension Pack
Viewing all articles
Browse latest Browse all 1211

Commented Issue: Key property of XmlFile -> AddElement task not used correctly [10979]

$
0
0
<MSBuild.ExtensionPack.Xml.XmlFile
TaskAction="AddElement"
File="$(OutputPath)app\AndroidManifest.xml"
Key="android:name"
Value="%(AndroidPermissions.Identity)"
Element="uses-permission"
XPath="/manifest"/>

I have this task. It addes permissions to AndroidManifest file. All things going to manifest file have "android:" prefix to their properties. For some reason the stuff before ":" disappears in the output.
Comments: ** Comment from web user: mikeFourie **

Ok so if you use Prexif I think it works, but your element gets prefixed too, e.g.

<ItemGroup>
<AndroidPermissions Include="bob"/>
<AndroidPermissions Include="bob2"/>
<AndroidPermissions Include="bob3"/>
<Namespaces Include="Mynamespace">
<Prefix>andriod</Prefix>
<Uri>http://schemas.android.com/apk/res/android</Uri>
</Namespaces>
</ItemGroup>
<Target Name="Default">
<MSBuild.ExtensionPack.Xml.XmlFile TaskAction="AddElement" Prefix="andriod" File="d:\a\AndroidManifest.xml" Key="name" Value="%(AndroidPermissions.Identity)" Element="uses-permission" Namespaces="@(Namespaces)" XPath="/manifest"/>
</Target>

Result:

<andriod:uses-permission andriod:name="bob" xmlns:andriod="http://schemas.android.com/apk/res/android" />
<andriod:uses-permission andriod:name="bob2" xmlns:andriod="http://schemas.android.com/apk/res/android" />
<andriod:uses-permission andriod:name="bob3" xmlns:andriod="http://schemas.android.com/apk/res/android" />


I'll get a fix in to get this to work better.

Mike


Viewing all articles
Browse latest Browse all 1211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>