-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Optimize _MvcCopyDependencyFiles and _GeneratePublishTestManifest targets to reduce Copy task overhead #63994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
ad352af
ef4f213
f00b5da
e13b85d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -55,7 +55,12 @@ | |||||
</ItemGroup> | ||||||
|
||||||
<GenerateMvcTestManifestTask ManifestPath="$(PublishDir)MvcTestingAppManifest.json" Projects="@(_PublishManifestProjects)" /> | ||||||
<Copy SourceFiles="%(_DepsFileToPublish.FullPath)" DestinationFolder="$(PublishDir)" Condition="Exists('%(_DepsFileToPublish.FullPath)')" /> | ||||||
|
||||||
<ItemGroup> | ||||||
<_DepsFilesToPublishResolved Include="%(_DepsFileToPublish.FullPath)" Condition="Exists('%(_DepsFileToPublish.FullPath)')" /> | ||||||
</ItemGroup> | ||||||
|
||||||
<Copy SourceFiles="@(_DepsFilesToPublishResolved)" DestinationFolder="$(PublishDir)" SkipUnchangedFiles="true" Condition="@(_DepsFilesToPublishResolved->Count()) > 0" /> | ||||||
</Target> | ||||||
|
||||||
<Target Name="_MvcCopyDependencyFiles" AfterTargets="Build;_ResolveMvcTestProjectReferences" Condition="'$(TargetFramework)'!=''"> | ||||||
|
@@ -70,11 +75,16 @@ | |||||
<_CreateSymbolicLinksForMvcCopyDependencyFilesIfPossible Condition="'$(_CreateSymbolicLinksMvcCopyDependencyFilesIfPossible)' == ''">$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)</_CreateSymbolicLinksForMvcCopyDependencyFilesIfPossible> | ||||||
</PropertyGroup> | ||||||
|
||||||
<Copy SourceFiles="%(DepsFilePaths.FullPath)" | ||||||
<ItemGroup> | ||||||
<_DepsFilesToCopy Include="@(DepsFilePaths)" Condition="Exists('%(DepsFilePaths.FullPath)')" /> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the previous comment, the condition
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
</ItemGroup> | ||||||
|
||||||
<Copy SourceFiles="@(_DepsFilesToCopy)" | ||||||
DestinationFolder="$(OutDir)" | ||||||
UseHardlinksIfPossible="$(_CreateHardLinksForMvcCopyDependencyFilesIfPossible)" | ||||||
UseSymboliclinksIfPossible="$(_CreateSymbolicLinksForMvcCopyDependencyFilesIfPossible)" | ||||||
Condition="Exists('%(DepsFilePaths.FullPath)')" /> | ||||||
SkipUnchangedFiles="true" | ||||||
Condition="@(_DepsFilesToCopy->Count()) > 0" /> | ||||||
</Target> | ||||||
|
||||||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition
Exists('%(_DepsFileToPublish.FullPath)')
is evaluated for each item in the batching operation. Consider moving the existence check to the Copy task condition or using a different approach to avoid repeated file system calls during item transformation.Copilot uses AI. Check for mistakes.