Last active
December 21, 2015 12:59
-
-
Save htuomola/4434914 to your computer and use it in GitHub Desktop.
MsBuild target to rename Windows Phone XAP packages after building to include build configuration & assembly version number. Note that as far as I know, it's not possible to delete the original XAP file as it is required for emulator deployment & debugging.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Target Name="AfterBuild"> | |
<GetAssemblyIdentity AssemblyFiles="$(OutputPath)\$(AssemblyName).dll"> | |
<Output TaskParameter="Assemblies" ItemName="MyAssemblyIdentities" /> | |
</GetAssemblyIdentity> | |
<PropertyGroup> | |
<XapFilenameWithoutExt>$(XapFilename.Replace('.xap',''))</XapFilenameWithoutExt> | |
<OutputXapFilename>$(XapFilenameWithoutExt)_$(Configuration)_%(MyAssemblyIdentities.Version).xap</OutputXapFilename> | |
</PropertyGroup> | |
<Message Text="Removing all files matching with '$(XapFilenameWithoutExt)_*.xap'" /> | |
<ItemGroup> | |
<OldXapFiles Include="$(OutputPath)\$(XapFilenameWithoutExt)_*.xap" /> | |
</ItemGroup> | |
<Delete Files="@(OldXapFiles)" /> | |
<Copy SourceFiles="$(OutputPath)\$(XapFilename)" DestinationFiles="$(OutputPath)\$(OutputXapFilename)" /> | |
</Target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment