You can add anything file that you want by using VSIXSourceItem
in your project file or using it from the separate imported project:
...
<!--You also can invoke this target before GetVsixSourceItems-->
<Target Name="ForceIncludeItems" AfterTargets="GetVsixSourceItems">
<ItemGroup>
<VSIXSourceItem Include="Path_to_your_xml_file" />
</ItemGroup>
</Target>
Also you can specify wildcards and functions to select a special files which you want:
...
<VSIXSourceItem Include="*.xml" Condition="$([System.String]::new('%FileName)').StartsWith('My_start_with_pattern'))"/>
More easy but less flexible way is setting IncludeDocFilesInVSIXContainer
to true:
...
<IncludeDocFilesInVSIXContainer>true</IncludeDocFilesInVSIXContainer>
In this way target will include all items which were included as @DocFileItem (as I know, by default it's only include xml file for vsix project itself).
So to add all xml files excluding suppressed by vsix build package you need to add them manually:
...
<IncludeDocFilesInVSIXContainer>true</IncludeDocFilesInVSIXContainer>
...
<Target Name="AppendNonSuppressXml" AfterTargets="GetVsixSourceItems">
<ItemGroup>
<SuppressXml Include="@(SuppressFromVsix->'%(FileName)')" /> <!-- store all suppressed assemblies names to avoid copying their xml files-->
</ItemGroup>
<PropertyGroup>
<SuppressAsString>$([System.String]::Join(';', @(SuppressXml))</SuppressAsString> <!-- use to emulate Collections.Contains(item)-->
</PropertyGroup>
<ItemGroup>
<!-- assume that xml files will be received from ReferenceCopyLocalPaths, you can use another source -->
<VSIXSourceItem
Include="@(ReferenceCopyLocalPaths)"
Condition="$(IncludeDocFilesInVSIXContainer) And '%(ReferenceCopyLocalPaths.Extension)' =='.xml'
And !($([System.String]::new($(SuppressAsString)).Contains('%(ReferenceCopyLocalPaths.FileName)')))" />
</ItemGroup>
</Target>