Microsoft.Web.Publishing.Deploy.FileSystem.targets 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <!--
  2. ***********************************************************************************************
  3. Microsoft.Web.Publishing.Deploy.FPSE.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 Deploy
  8. Currently
  9. Copyright (C) Microsoft Corporation. All rights reserved.
  10. ***********************************************************************************************
  11. -->
  12. <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  13. <!--Import task from our dll-->
  14. <UsingTask TaskName="GetPublishingLocalizedString" AssemblyFile="..\Microsoft.Web.Publishing.Tasks.dll"/>
  15. <UsingTask TaskName="CopyPipelineFiles" AssemblyFile="..\Microsoft.Web.Publishing.Tasks.dll"/>
  16. <!--Append WebFTPPublish to the supported list.-->
  17. <PropertyGroup>
  18. <_WPPWebPublishMethodSupports>$(_WPPWebPublishMethodSupports);WebFileSystemPublish</_WPPWebPublishMethodSupports>
  19. </PropertyGroup>
  20. <!--********************************************************************-->
  21. <!--Target WebFileSystemPublish -->
  22. <!--********************************************************************-->
  23. <PropertyGroup>
  24. <WebFileSystemPublishDependsOn>
  25. $(OnBeforeWebFileSystemPublish);
  26. $(WebFileSystemPublishDependsOn);
  27. </WebFileSystemPublishDependsOn>
  28. <WebFileSystemPublishDependsOn>
  29. $(WebFileSystemPublishDependsOn);
  30. PipelinePreDeployCopyAllFilesToOneFolder;
  31. </WebFileSystemPublishDependsOn>
  32. </PropertyGroup>
  33. <Target Name="WebFileSystemPublish"
  34. DependsOnTargets="$(WebFileSystemPublishDependsOn)"
  35. Condition="'$(WebFileSystemPublish)' != 'False'">
  36. <PropertyGroup>
  37. <_DoWebFileSystemPublishDeleteExtraFiles>False</_DoWebFileSystemPublishDeleteExtraFiles>
  38. <_DoWebFileSystemPublishDeleteExtraFiles Condition= "'$(DeleteExistingFiles)' == 'True'" >True</_DoWebFileSystemPublishDeleteExtraFiles>
  39. <_HttpHeader>http://</_HttpHeader>
  40. <_DoWebFileSystemPublish>False</_DoWebFileSystemPublish>
  41. <_DoWebFileSystemPublish Condition="'$(PublishUrl)'!='' And '$(PublishUrl.StartsWith($(_HttpHeader), StringComparison.OrdinalIgnoreCase))' == 'False' And '$([System.IO.Path]::GetFullPath($(PublishUrl)))' != ''">True</_DoWebFileSystemPublish>
  42. </PropertyGroup>
  43. <!--This is not yet implemented through the command line for now error it out-->
  44. <GetPublishingLocalizedString
  45. Condition="!$(_DoWebFileSystemPublish)"
  46. ID="PublishLocalizedString_WebPublishMethodIsNotSupportedInCmdLine"
  47. ArgumentCount="1"
  48. Arguments="$(WebPublishMethod)"
  49. LogType="Error" />
  50. <Error Text ="Target WebFileSystemPublish Failed"
  51. Condition="!$(_DoWebFileSystemPublish)"
  52. />
  53. <ItemGroup Condition="$(_DoWebFileSystemPublish)">
  54. <FilesForFileCopy Remove="$(FilesForFileCopy)" />
  55. </ItemGroup>
  56. <CollectFilesinFolder RootPath="$(WPPAllFilesInSingleFolder)"
  57. Condition="$(_DoWebFileSystemPublish)" >
  58. <Output TaskParameter="Result" ItemName="_AllFilesUnder_WPPAllFilesInSingleFolder" />
  59. </CollectFilesinFolder>
  60. <ItemGroup>
  61. <FilesForFileCopy Include="@(_AllFilesUnder_WPPAllFilesInSingleFolder)" >
  62. <DestinationRelativePath>%(_AllFilesUnder_WPPAllFilesInSingleFolder.Identity)</DestinationRelativePath>
  63. <FromTarget>WebFileSystemPublish</FromTarget>
  64. <Category>AllFilesInFolder</Category>
  65. </FilesForFileCopy>
  66. </ItemGroup>
  67. <!-- In the case of the incremental Packaging/Publish, we need to find out the extra file and delee them-->
  68. <ItemGroup Condition="'$(DeleteExistingFiles)' == 'True'">
  69. <_AllExtraFilesUnderPublishUrl Include="$(PublishUrl)\**" />
  70. <_AllExtraFilesUnderPublishUrl
  71. Remove="@(FilesForFileCopy->'$(PublishUrl)\%(DestinationRelativePath)')" />
  72. </ItemGroup>
  73. <!--Remove all extra files in the temp folder that's not in the @(FilesForPackagingFromProject-->
  74. <Delete Files="@(_AllExtraFilesUnderPublishUrl)" />
  75. <!-- Make sure the folder exist -->
  76. <MakeDir Directories="$(PublishUrl)" Condition="$(_DoWebFileSystemPublish) And !Exists('$(PublishUrl)')"/>
  77. <!--Force Copy Of all file to the WPPAllFilesInSingleFolder if needed-->
  78. <CopyPipelineFiles Condition="$(_DoWebFileSystemPublish)"
  79. PipelineItems="@(FilesForFileCopy)"
  80. SourceDirectory="$(WPPAllFilesInSingleFolder)"
  81. TargetDirectory="$(PublishUrl)"
  82. SkipMetadataExcludeTrueItems="False"
  83. UpdateItemSpec="True"
  84. DeleteItemsMarkAsExcludeTrue ="False">
  85. <Output TaskParameter="ResultPipelineItems" ItemName="_FilesForFileCopyAfterFileSystemPublish"/>
  86. </CopyPipelineFiles>
  87. <CallTarget Targets="$(OnAfterWebFileSystemPublish)" RunEachTargetSeparately="False" />
  88. </Target>
  89. <!--ImportAfter Extension-->
  90. <PropertyGroup>
  91. <ImportByWildcardAfterMicrosoftWebPublishingDeployFileSystemTargets Condition="'$(ImportByWildcardAfterMicrosoftWebPublishingDeployFileSystemTargets)'==''">true</ImportByWildcardAfterMicrosoftWebPublishingDeployFileSystemTargets>
  92. </PropertyGroup>
  93. <Import Project="$(MSBuildThisFileDirectory)\$(MSBuildThisFileName)\ImportAfter\*" Condition="'$(ImportByWildcardAfterMicrosoftWebPublishingDeployFileSystemTargets)' == 'true' and exists('$(MSBuildThisFileDirectory)\$(MSBuildThisFileName)\ImportAfter')"/>
  94. </Project>