Microsoft.Web.Publishing.AllFilesInTheProject.targets 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <!--
  2. ***********************************************************************************************
  3. Microsoft.Web.Publishing.AllFilesInTheProject.targets
  4. WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
  5. created a backup copy. Incorrect changes to this file will make it
  6. impossible to load or build your web deploy projects from the command-line or the IDE.
  7. This file defines the steps in the standard package/publish process for collecting only project files .
  8. Copyright (C) Microsoft Corporation. All rights reserved.
  9. ***********************************************************************************************
  10. -->
  11. <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  12. <!--ImportBefore Extension-->
  13. <PropertyGroup>
  14. <ImportByWildcardBeforeMicrosoftWebPublishingAllFilesInTheProjectTargets Condition="'$(ImportByWildcardBeforeMicrosoftWebPublishingAllFilesInTheProjectTargets)'==''">true</ImportByWildcardBeforeMicrosoftWebPublishingAllFilesInTheProjectTargets>
  15. </PropertyGroup>
  16. <Import Project="$(MSBuildThisFileDirectory)\$(MSBuildThisFileName)\ImportBefore\*" Condition="'$(ImportByWildcardBeforeMicrosoftWebPublishingAllFilesInTheProjectTargets)' == 'true' and exists('$(MSBuildThisFileDirectory)\$(MSBuildThisFileName)\ImportBefore')"/>
  17. <!--The following property need to set before import of Microsoft.Web.Publishing.OnlyFilesToRunTheApp.targets or it will set the property first-->
  18. <PropertyGroup>
  19. <!--Overwrite the default behavior. Don't remove the web.debug.config -->
  20. <ExcludeTransformAssistFilesFromPublish Condition="'$(ExcludeTransformAssistFilesFromPublish)'==''">False</ExcludeTransformAssistFilesFromPublish>
  21. </PropertyGroup>
  22. <!--We need all of the item in the minimum run web needed-->
  23. <Import Project="Microsoft.Web.Publishing.OnlyFilesToRunTheApp.targets"/>
  24. <PropertyGroup>
  25. <PublishPipelineCollectFilesCore>
  26. $(PublishPipelineCollectFilesCore);
  27. CollectFilesFromCompile;
  28. CollectFilesFromEmbeddedResource;
  29. CollectFilesFromNone;
  30. CollectFilesFromBaseApplicationManifest;
  31. CollectFilesFromProjectFile;
  32. </PublishPipelineCollectFilesCore>
  33. </PropertyGroup>
  34. <!--MSBuild target does not have a good way to identify all item in the project yet.
  35. MSBuild team is working on this. At the same time, we are working backward from only known common item collection from
  36. The following is base on http://msdn.microsoft.com/en-us/library/bb629388.aspx for common project item.
  37. Note that Content Collection is already in the Microsoft.Web.Publishing.OnlyFilesToRunTheApp.targets-->
  38. <!--********************************************************************-->
  39. <!-- Task CollectFilesFromCompile -->
  40. <!--********************************************************************-->
  41. <PropertyGroup>
  42. <CollectFilesFromCompileDependsOn>
  43. $(OnBeforeCollectFilesFromCompile);
  44. $(CollectFilesFromCompileDependsOn);
  45. </CollectFilesFromCompileDependsOn>
  46. </PropertyGroup>
  47. <Target Name="CollectFilesFromCompile"
  48. DependsOnTargets="$(CollectFilesFromCompileDependsOn)"
  49. Condition="'@(Compile)'!=''">
  50. <!--Get Localized string before display message-->
  51. <GetPublishingLocalizedString
  52. ID="PublishLocalizedString_GatherSpecificItemsFromProject"
  53. ArgumentCount="1"
  54. Arguments="Compile"
  55. LogType="Message" />
  56. <Message Text="@(Compile)" />
  57. <ItemGroup>
  58. <FilesForPackagingFromProject Include="@(Compile)" Condition="'%(Compile.Link)'==''">
  59. <DestinationRelativePath>%(Compile.Identity)</DestinationRelativePath>
  60. <FromTarget>CollectFilesFromCompile</FromTarget>
  61. <Category>ProjectNotRunRequired</Category>
  62. </FilesForPackagingFromProject>
  63. <FilesForPackagingFromProject Include="@(Compile)" Condition="'%(Compile.Link)'!='' And $(EnableCollectLinkFilesInProject)">
  64. <DestinationRelativePath>%(Compile.Link)</DestinationRelativePath>
  65. <FromTarget>CollectFilesFromCompile</FromTarget>
  66. <Category>ProjectNotRunRequired</Category>
  67. <Exclude>$(ExcludeLinkFilesInProject)</Exclude>
  68. <ProjectFileType>Link</ProjectFileType>
  69. </FilesForPackagingFromProject>
  70. </ItemGroup>
  71. <CallTarget Targets="$(OnAfterCollectFilesFromCompile)" RunEachTargetSeparately="false" />
  72. </Target>
  73. <!--********************************************************************-->
  74. <!-- Task CollectFilesFromEmbeddedResource -->
  75. <!--********************************************************************-->
  76. <PropertyGroup>
  77. <CollectFilesFromEmbeddedResourceDependsOn>
  78. $(OnBeforeCollectFilesFromEmbeddedResource);
  79. $(CollectFilesFromEmbeddedResourceDependsOn);
  80. </CollectFilesFromEmbeddedResourceDependsOn>
  81. </PropertyGroup>
  82. <Target Name="CollectFilesFromEmbeddedResource"
  83. DependsOnTargets="$(CollectFilesFromEmbeddedResourceDependsOn)"
  84. Condition="'@(EmbeddedResource)'!=''">
  85. <!--Get Localized string before display message-->
  86. <GetPublishingLocalizedString
  87. ID="PublishLocalizedString_GatherSpecificItemsFromProject"
  88. ArgumentCount="1"
  89. Arguments="EmbeddedResource"
  90. LogType="Message" />
  91. <Message Text="@(EmbeddedResource)" />
  92. <ItemGroup>
  93. <FilesForPackagingFromProject Include="@(EmbeddedResource)" Condition="'%(EmbeddedResource.Link)'==''">
  94. <DestinationRelativePath>%(EmbeddedResource.Identity)</DestinationRelativePath>
  95. <FromTarget>CollectFilesFromEmbeddedResource</FromTarget>
  96. <Category>ProjectNotRunRequired</Category>
  97. </FilesForPackagingFromProject>
  98. <FilesForPackagingFromProject Include="@(EmbeddedResource)" Condition="'%(EmbeddedResource.Link)'!='' And $(EnableCollectLinkFilesInProject)">
  99. <DestinationRelativePath>%(EmbeddedResource.Link)</DestinationRelativePath>
  100. <FromTarget>CollectFilesFromEmbeddedResource</FromTarget>
  101. <Category>ProjectNotRunRequired</Category>
  102. <Exclude>$(ExcludeLinkFilesInProject)</Exclude>
  103. <ProjectFileType>Link</ProjectFileType>
  104. </FilesForPackagingFromProject>
  105. </ItemGroup>
  106. <CallTarget Targets="$(OnAfterCollectFilesFromEmbeddedResource)" RunEachTargetSeparately="false" />
  107. </Target>
  108. <!--********************************************************************-->
  109. <!-- Task CollectFilesFromNone -->
  110. <!--********************************************************************-->
  111. <PropertyGroup>
  112. <CollectFilesFromNoneDependsOn>
  113. $(OnBeforeCollectFilesFromNone);
  114. $(CollectFilesFromNoneDependsOn);
  115. </CollectFilesFromNoneDependsOn>
  116. </PropertyGroup>
  117. <Target Name="CollectFilesFromNone"
  118. DependsOnTargets="$(CollectFilesFromNoneDependsOn)"
  119. Condition="'@(None)'!=''">
  120. <GetPublishingLocalizedString
  121. ID="PublishLocalizedString_GatherSpecificItemsFromProject"
  122. ArgumentCount="1"
  123. Arguments="None"
  124. LogType="Message" />
  125. <Message Text="@(None)" />
  126. <ItemGroup>
  127. <FilesForPackagingFromProject Include="@(None)" Condition="'%(None.Link)'==''">
  128. <DestinationRelativePath>%(None.Identity)</DestinationRelativePath>
  129. <FromTarget>CollectFilesFromNone</FromTarget>
  130. <Category>ProjectNotRunRequired</Category>
  131. </FilesForPackagingFromProject>
  132. <FilesForPackagingFromProject Include="@(None)" Condition="'%(None.Link)'!='' And $(EnableCollectLinkFilesInProject)" >
  133. <DestinationRelativePath>%(None.Link)</DestinationRelativePath>
  134. <FromTarget>CollectFilesFromNone</FromTarget>
  135. <Category>ProjectNotRunRequired</Category>
  136. <Exclude>$(ExcludeLinkFilesInProject)</Exclude>
  137. <ProjectFileType>Link</ProjectFileType>
  138. </FilesForPackagingFromProject>
  139. </ItemGroup>
  140. <CallTarget Targets="$(OnAfterCollectFilesFromNone)" RunEachTargetSeparately="false" />
  141. </Target>
  142. <!--********************************************************************-->
  143. <!-- Task CollectFilesFromBaseApplicationManifest -->
  144. <!--********************************************************************-->
  145. <PropertyGroup>
  146. <CollectFilesFromBaseApplicationManifestDependsOn>
  147. $(OnBeforeCollectFilesFromBaseApplicationManifest);
  148. $(CollectFilesFromBaseApplicationManifestDependsOn);
  149. </CollectFilesFromBaseApplicationManifestDependsOn>
  150. </PropertyGroup>
  151. <Target Name="CollectFilesFromBaseApplicationManifest"
  152. DependsOnTargets="$(CollectFilesFromBaseApplicationManifestDependsOn)"
  153. Condition="'@(BaseApplicationManifest)'!=''">
  154. <!--Get Localized string before display message-->
  155. <GetPublishingLocalizedString
  156. ID="PublishLocalizedString_GatherSpecificItemsFromProject"
  157. ArgumentCount="1"
  158. Arguments="BaseApplicationManifest"
  159. LogType="Message" />
  160. <Message Text="@(BaseApplicationManifest)" />
  161. <ItemGroup>
  162. <FilesForPackagingFromProject Include="@(BaseApplicationManifest)" Condition="'%(BaseApplicationManifest.Link)'==''">
  163. <DestinationRelativePath>%(BaseApplicationManifest.Identity)</DestinationRelativePath>
  164. <FromTarget>CollectFilesFromBaseApplicationManifest</FromTarget>
  165. <Category>ProjectNotRunRequired</Category>
  166. </FilesForPackagingFromProject>
  167. <FilesForPackagingFromProject Include="@(BaseApplicationManifest)" Condition="'%(BaseApplicationManifest.Link)'!='' And $(EnableCollectLinkFilesInProject)">
  168. <DestinationRelativePath>%(BaseApplicationManifest.Link)</DestinationRelativePath>
  169. <FromTarget>CollectFilesFromBaseApplicationManifest</FromTarget>
  170. <Category>ProjectNotRunRequired</Category>
  171. <Exclude>$(ExcludeLinkFilesInProject)</Exclude>
  172. <ProjectFileType>Link</ProjectFileType>
  173. </FilesForPackagingFromProject>
  174. </ItemGroup>
  175. <CallTarget Targets="$(OnAfterCollectFilesFromBaseApplicationManifest)" RunEachTargetSeparately="false" />
  176. </Target>
  177. <!--********************************************************************-->
  178. <!-- Task CollectFilesFromProjectFile -->
  179. <!--********************************************************************-->
  180. <PropertyGroup>
  181. <CollectFilesFromProjectFileDependsOn>
  182. $(OnBeforeCollectFilesFromProjectFile);
  183. $(CollectFilesFromProjectFileDependsOn);
  184. </CollectFilesFromProjectFileDependsOn>
  185. </PropertyGroup>
  186. <Target Name="CollectFilesFromProjectFile"
  187. DependsOnTargets="$(CollectFilesFromProjectFileDependsOn)">
  188. <!--Get Localized string before display message-->
  189. <GetPublishingLocalizedString
  190. ID="PublishLocalizedString_GatherSpecificItemsFromProject"
  191. ArgumentCount="1"
  192. Arguments="ProjectFiles"
  193. LogType="Message" />
  194. <Message Text="$(MSBuildProjectFile);$(MSBuildProjectFile).user" />
  195. <ItemGroup>
  196. <FilesForPackagingFromProject Include="$(MSBuildProjectFile)">
  197. <DestinationRelativePath>$(MSBuildProjectFile)</DestinationRelativePath>
  198. <FromTarget>CollectFilesFromProjectFile</FromTarget>
  199. <Category>ProjectNotRunRequired</Category>
  200. </FilesForPackagingFromProject>
  201. <FilesForPackagingFromProject Include="$(MSBuildProjectFile).user" Condition="Exists('$(MSBuildProjectFile).user')">
  202. <DestinationRelativePath>$(MSBuildProjectFile).user</DestinationRelativePath>
  203. <FromTarget>CollectFilesFromProjectFile</FromTarget>
  204. <Category>ProjectNotRunRequired</Category>
  205. </FilesForPackagingFromProject>
  206. </ItemGroup>
  207. <CallTarget Targets="$(OnAfterCollectFilesFromProjectFile)" RunEachTargetSeparately="false" />
  208. </Target>
  209. <!--ImportAfter Extension-->
  210. <PropertyGroup>
  211. <ImportByWildcardAfterMicrosoftWebPublishingAllFilesInTheProjectTargets Condition="'$(ImportByWildcardAfterMicrosoftWebPublishingAllFilesInTheProjectTargets)'==''">true</ImportByWildcardAfterMicrosoftWebPublishingAllFilesInTheProjectTargets>
  212. </PropertyGroup>
  213. <Import Project="$(MSBuildThisFileDirectory)\$(MSBuildThisFileName)\ImportAfter\*" Condition="'$(ImportByWildcardAfterMicrosoftWebPublishingAllFilesInTheProjectTargets)' == 'true' and exists('$(MSBuildThisFileDirectory)\$(MSBuildThisFileName)\ImportAfter')"/>
  214. </Project>