123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- <!--
- ***********************************************************************************************
- Microsoft.Web.Publishing.AllFilesInProjectFolder.targets
- WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
- created a backup copy. Incorrect changes to this file will make it
- impossible to load or build your web deploy projects from the command-line or the IDE.
- This file defines the steps in the standard package/publish process for collecting all files in the project folder.
- Copyright (C) Microsoft Corporation. All rights reserved.
- ***********************************************************************************************
- -->
- <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <!--Import task from our dll-->
- <UsingTask TaskName="CollectFilesinFolder" AssemblyFile="..\Microsoft.Web.Publishing.Tasks.dll"/>
- <UsingTask TaskName="EscapeTextForRegularExpressions" AssemblyFile="..\Microsoft.Web.Publishing.Tasks.dll"/>
- <UsingTask TaskName="FilterByItems" AssemblyFile="..\Microsoft.Web.Publishing.Tasks.dll"/>
- <UsingTask TaskName="GetPublishingLocalizedString" AssemblyFile="..\Microsoft.Web.Publishing.Tasks.dll"/>
- <!--ImportBefore Extension-->
- <PropertyGroup>
- <ImportByWildcardBeforeMicrosoftWebPublishingAllFilesInProjectFolderTargets Condition="'$(ImportByWildcardBeforeMicrosoftWebPublishingAllFilesInProjectFolderTargets)'==''">true</ImportByWildcardBeforeMicrosoftWebPublishingAllFilesInProjectFolderTargets>
- </PropertyGroup>
- <Import Project="$(MSBuildThisFileDirectory)\$(MSBuildThisFileName)\ImportBefore\*" Condition="'$(ImportByWildcardBeforeMicrosoftWebPublishingAllFilesInProjectFolderTargets)' == 'true' and exists('$(MSBuildThisFileDirectory)\$(MSBuildThisFileName)\ImportBefore')"/>
- <PropertyGroup>
- <PublishPipelineCollectFilesCore>
- $(PublishPipelineCollectFilesCore);
- CollectFilesFromProjectFolder;
- </PublishPipelineCollectFilesCore>
- <_CollectFiles_IncludeIgnorableFile Condition="'$(_CollectFiles_IncludeIgnorableFile)'==''">False</_CollectFiles_IncludeIgnorableFile>
- <!--Overwrite the default behavior. Don't remove the web.debug.config -->
- <ExcludeTransformAssistFilesFromPublish Condition="'$(ExcludeTransformAssistFilesFromPublish)'==''">False</ExcludeTransformAssistFilesFromPublish>
- <CollectFilesFromProjectFolder_ExcludeSccFiles Condition="'$(CollectFilesFromProjectFolder_ExcludeSccFiles)'==''">True</CollectFilesFromProjectFolder_ExcludeSccFiles>
- </PropertyGroup>
- <!--********************************************************************-->
- <!-- Task SetExcludeFromProjectFolder -->
- <!--********************************************************************-->
- <PropertyGroup>
- <SetExcludeFromProjectFolderDependsOn Condition="'$(SetExcludeFromProjectFolderDependsOn)'==''">
- </SetExcludeFromProjectFolderDependsOn>
- </PropertyGroup>
- <Target Name="SetExcludeFromProjectFolder"
- DependsOnTargets="$(SetExcludeFromProjectFolderDependsOn)">
- <!--Get Localized string before display message-->
- <GetPublishingLocalizedString
- ID="PublishLocalizedString_DefaultExcludeIntermediateOutputFolderMessage"
- LogType="Message" />
-
- <GetPublishingLocalizedString
- ID="PublishLocalizedString_DefaultExcludeFileExtentionOutMessage"
- LogType="Message" />
- <GetPublishingLocalizedString
- ID="PublishLocalizedString_DefaultExcludeSourceControlItems"
- LogType="Message" />
- <!--Maybe we need to introduce @(_ExcludeFromProjectFolder)-->
- <ItemGroup>
- <!--Split item to _KnowProjectItems is to keep the metadata for item collection.
- Please see http://msdn.microsoft.com/en-us/library/bb629388.aspx for known Project item collection.-->
- <_KnownProjectItems Include="@(EmbeddedResource)" />
- <_KnownProjectItems Include="@(None)" />
- <_KnownProjectItems Include="@(Content)" />
- <_KnownProjectItems Include="@(Compile)" />
- <!--Explicit exclude all files under the obj folder -->
- <_ProjectBaseIntermediateOutputPath Include="$(BaseIntermediateOutputPath)"/>
-
- </ItemGroup>
- <!--Create the rgulare expression to exclude all root folder *.out, all folder *.scc and all folder*.vspscc file-->
- <!--Note split by semicolon (;)-->
- <PropertyGroup>
- <_ExcludeRelativePathFromProjectFolder>^[^\\]*\.out$</_ExcludeRelativePathFromProjectFolder>
- </PropertyGroup>
- <!--Create the rgulare expression to exclude all Intermedidate output path.-->
- <EscapeTextForRegularExpressions Text="@(_ProjectBaseIntermediateOutputPath->'%(FullPath)')">
- <Output TaskParameter="Result" PropertyName="_ExcludeFullPathFromProjectFolder" />
- </EscapeTextForRegularExpressions>
- </Target>
- <!--********************************************************************-->
- <!-- Task CollectFilesFromProjectFolder_ExcludeSccFiles -->
- <!--********************************************************************-->
- <PropertyGroup>
- <CollectFilesFromProjectFolder_ExcludeSccFilesDependsOn>
- $(OnBeforeCollectFilesFromProjectFolder_ExcludeSccFiles);
- $(CollectFilesFromProjectFolder_ExcludeSccFilesDependsOn);
- SetExcludeFromProjectFolder;
- </CollectFilesFromProjectFolder_ExcludeSccFilesDependsOn>
- </PropertyGroup>
- <Target Name="CollectFilesFromProjectFolder_ExcludeSccFiles"
- DependsOnTargets="$(CollectFilesFromProjectFolder_ExcludeSccFilesDependsOn)"
- Condition="$(CollectFilesFromProjectFolder_ExcludeSccFiles)">
- <!--Note split by semicolon (;)-->
- <PropertyGroup>
- <_ExcludeRelativePathFromProjectFolder>$(_ExcludeRelativePathFromProjectFolder);[^\\]*\.scc$;[^\\]*\.vssscc$;[^\\]*\.vspscc$</_ExcludeRelativePathFromProjectFolder>
- </PropertyGroup>
- <CallTarget Targets="$(OnAfterCollectFilesFromProjectFolder_ExcludeSccFiles)" RunEachTargetSeparately="false" />
- </Target>
-
-
-
- <!--********************************************************************-->
- <!-- Task CollectFilesFromProjectFolder -->
- <!--********************************************************************-->
- <PropertyGroup>
- <CollectFilesFromProjectFolderDependsOn>
- $(OnBeforeCollectFilesFromProjectFolder);
- $(CollectFilesFromProjectFolderDependsOn);
- SetExcludeFromProjectFolder;
- CollectFilesFromProjectFolder_ExcludeSccFiles;
- </CollectFilesFromProjectFolderDependsOn>
- </PropertyGroup>
- <Target Name="CollectFilesFromProjectFolder"
- DependsOnTargets="$(CollectFilesFromProjectFolderDependsOn)" >
- <!--Get Localized string before display message-->
- <GetPublishingLocalizedString
- ID="PublishLocalizedString_GatherAllFilesInProjectFolderExceptExclusion"
- LogType="Message" />
- <CollectFilesinFolder RootPath="$(WebPublishPipelineProjectDirectory)"
- ExcludeFullPathMatchs="$(_ExcludeFullPathFromProjectFolder)"
- ExcludeRelativePathMatchs="$(_ExcludeRelativePathFromProjectFolder)"
- SkipHiddenItems="$(_SkipHiddenItems)">
- <Output TaskParameter="Result" ItemName="_AllFilesUnderProjectFolderNoMetadata" />
- </CollectFilesinFolder>
-
- <!--The first two lines keeps the _KnowProjectItem's item metadata-->
- <FilterByItems PipelineItems="@(_AllFilesUnderProjectFolderNoMetadata)"
- Filter="@(_KnownProjectItems)">
- <Output TaskParameter="OutFilter" ItemName="_AllFilesUnderProjectFolderExceptKnownProjectItems"/>
- </FilterByItems>
-
- <ItemGroup>
- <!--Readd _KnowProjectItem's to keep item metadata. First for non-Link file -->
- <FilesForPackagingFromProject Include="@(_KnownProjectItems)" Condition="'%(_KnownProjectItems.Link)'==''">
- <DestinationRelativePath>%(_KnownProjectItems.Identity)</DestinationRelativePath>
- <FromTarget>CollectFilesFromProjectFolder.KonwnProjectItems</FromTarget>
- <Category>AllFilesInProjectFolder</Category>
- </FilesForPackagingFromProject>
- <FilesForPackagingFromProject Include="@(_KnownProjectItems)" Condition="'%(_KnownProjectItems.Link)'!='' And $(EnableCollectLinkFilesInProject)">
- <DestinationRelativePath>%(_KnownProjectItems.Link)</DestinationRelativePath>
- <FromTarget>CollectFilesFromProjectFolder.KonwnProjectItems</FromTarget>
- <Category>AllFilesInProjectFolder</Category>
- <Exclude>$(ExcludeLinkFilesInProject)</Exclude>
- <ProjectFileType>Link</ProjectFileType>
- </FilesForPackagingFromProject>
-
- <FilesForPackagingFromProject Include="@(_AllFilesUnderProjectFolderExceptKnownProjectItems)" >
- <DestinationRelativePath>%(_AllFilesUnderProjectFolderExceptKnownProjectItems.Identity)</DestinationRelativePath>
- <FromTarget>CollectFilesFromProjectFolder.ExceptKonwnProjectItems</FromTarget>
- <Category>AllFilesInProjectFolder</Category>
- </FilesForPackagingFromProject>
- </ItemGroup>
- <CallTarget Targets="$(OnAfterCollectFilesFromProjectFolder)" RunEachTargetSeparately="false" />
- </Target>
- <!--ImportAfter Extension-->
- <PropertyGroup>
- <ImportByWildcardAfterMicrosoftWebPublishingAllFilesInProjectFolderTargets Condition="'$(ImportByWildcardAfterMicrosoftWebPublishingAllFilesInProjectFolderTargets)'==''">true</ImportByWildcardAfterMicrosoftWebPublishingAllFilesInProjectFolderTargets>
- </PropertyGroup>
- <Import Project="$(MSBuildThisFileDirectory)\$(MSBuildThisFileName)\ImportAfter\*" Condition="'$(ImportByWildcardAfterMicrosoftWebPublishingAllFilesInProjectFolderTargets)' == 'true' and exists('$(MSBuildThisFileDirectory)\$(MSBuildThisFileName)\ImportAfter')"/>
- </Project>
|