-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Copy task SourceFolders #8843
Copy task SourceFolders #8843
Conversation
Can the build be re-run? Or is it necessary to push a new commit? Update: Pushed a new commit to address a TODO. The question remains. When the PR build fails for causes in the build infrastructure and not the repo, is there a way to re-run the build or request that the build be re-run? In the backing Azure Pipelines, I can only view. In the GitHub desktop client, there is a "Re-run Checks" button. Clicking the button for the dotnet/msbuild repo does nothing. |
This reverts commit c8db782.
You can write "/azp run" in the comment to the PR to re-run checks. |
Commenter does not have sufficient privileges for PR 8843 in repo dotnet/msbuild |
Yeah, only committers have permission for |
Just a note that a unit test unrelated to the commit(s) failed and then on the next build passed. build: Windows Core The log shows
|
…onFiles list as TwoVectorsMustHaveSameLength error
LGTM Merge after Alina's comments are addressed. |
Just pushed a commit to address both comments |
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.
LGTM
Our main currently cannot take PRs with new features. We will merge this as soon as our main is open. |
Is the new capability documented anywhere? I’d like to see a couple of examples. |
Feature is fully described in the issue with feature request: |
does the description in the issue match the actual implementation? I’m afraid documenting a feature in an issue is insufficient. Ideally if there’s existing documentation for the Copy task, we should augment that. |
Yes, I agree, documenting in an issue is insufficient, we should add this to https://learn.microsoft.com/en-us/visualstudio/msbuild/copy-task. |
Fixes #5881
Context
Implementation of proposed
ITaskItem[] SourceFolders
parameter.Changes Made
Within Copy.cs:
ITaskItem[] SourceFolders
parameterValidateInputs()
to support the new parameterInitializeDestinationFiles()
SourceFiles
to createDestinationFiles
items given theDestinationFolder
.Copy
task actually only operates onSourceFiles
andDestinationFiles
.FileMatcher::GetFiles()
for each directory inSourceFolders
SourceFiles
andDestinationFiles
for each file foundAdded additional unit tests in Copy_Tests.cs.
Added new error MSB3894
Copy.IncompatibleParameters
for the case whereSourceFolders
andDestinationFiles
are both present. This is very close to the existing MSB3022Copy.ExactlyOneTypeOfDestination
but it seemed prudent not to re-use MSB3022.Testing
Tested on Windows 11 and macOS 12
Ran full suite of unit tests from the command line
Ran some sample project files
Notes
This implementation conforms to the proposed design with the exception that it does not copy empty directories.
This implementation leverages the existing
FileMatcher::GetFiles()
which recurses the directory tree using multiple threads.GetFiles()
returns a list of files. Empty directories are not identified.The use of
FileMatcher
could be replaced. TheCopy
task could implement its own support for recursing a directory tree. The wildcard matching logic inFileMatcher
is not relevant for theCopy
task.