Skip to content

Commit

Permalink
Replace the MSBuild.Microsoft.VisualStudio.Web.targets reference by a…
Browse files Browse the repository at this point in the history
… local copy
  • Loading branch information
kevinchalet committed Jun 24, 2024
1 parent 9c601eb commit 0f375e5
Show file tree
Hide file tree
Showing 26 changed files with 10,447 additions and 4 deletions.
1 change: 0 additions & 1 deletion eng/Tools.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project>

<ItemGroup>
<PackageReference Include="MSBuild.Microsoft.VisualStudio.Web.targets" Version="14.0.0.3" IsImplicitlyDefined="true" />
<PackageReference Include="NuGet.Build.Tasks.Pack" Version="5.10.0" IsImplicitlyDefined="true" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
<!--
***********************************************************************************************
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>

Loading

0 comments on commit 0f375e5

Please sign in to comment.