101101 <PublishProfile >Properties\PublishProfiles\win10-$(Platform).pubxml</PublishProfile >
102102 </ProjectReference >
103103 </ItemGroup >
104+ <ItemGroup >
105+ <PackageReference Include =" GitInfo" Version =" 2.3.0" />
106+ </ItemGroup >
104107 <Import Project =" $(SolutionDir)SharedProps\WindowsSDK.props" />
105108 <Import Project =" $(WapProjPath)\Microsoft.DesktopBridge.targets" />
106- </Project >
109+ <Import Project =" $(SolutionDir)SharedProps\ScratchVersion.targets" />
110+ <Target Name =" ScratchModifyAppxManifest" BeforeTargets =" _ValidatePresenceOfAppxManifestItems" DependsOnTargets =" ScratchVersion" >
111+ <Copy SourceFiles =" @(AppxManifest)" DestinationFolder =" $(IntermediateOutputPath)" />
112+ <!-- Do a three-step swap to replace @AppxManifest with a version prefixed with the intermediate path -->
113+ <!-- Note that '%' in MSBuild-speak causes a "for each"-style iteration -->
114+ <!-- @(AppxManifest) should only ever have 1 item, but it's a list so we have to treat it that way -->
115+ <ItemGroup >
116+ <!-- Make a new prefixed item in a temporary list -->
117+ <_ScratchAppxManifest Include =" $(IntermediateOutputPath)%(AppxManifest.Identity)" />
118+ <!-- Remove the old un-prefixed item from the original list -->
119+ <AppxManifest Remove =" %(AppxManifest.Identity)" />
120+ <!-- Add the item from the temporary list into the official list -->
121+ <AppxManifest Include =" %(_ScratchAppxManifest.Identity)" />
122+ </ItemGroup >
123+ <PropertyGroup >
124+ <!-- XmlPoke doesn't support implicit namespacing -->
125+ <_ScratchAppxManifestNamespaces >
126+ <Namespace Prefix =" am" Uri =" http://schemas.microsoft.com/appx/manifest/foundation/windows10" />
127+ </_ScratchAppxManifestNamespaces >
128+ </PropertyGroup >
129+ <!-- Inject the correct version into the XML file in the intermediate path -->
130+ <XmlPoke
131+ XmlInputPath =" %(AppxManifest.Identity)"
132+ Query =" /am:Package/am:Identity/@Version"
133+ Value =" $(ScratchVersionQuad)"
134+ Namespaces =" $(_ScratchAppxManifestNamespaces)"
135+ />
136+ </Target >
137+ </Project >
0 commit comments