-
-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Is the feature request related to a problem
Is there a way to exclude (specific) empty files?
EmptyFiles creates a lot of files on disk, even if there's no specific need to the project/solution that is transitively consuming this (via eg. DiffEngine/Verify). For one of my (multi-targeted) solutions, I currently count 49 files per test project, per target framework, which equates to over 1400 files. This creates a lot of I/O, even if the files are small.
My project uses none of the file extension specific verifications, it just does plain *.cs or *.json diffs, but still we have to pay the penalty of including all these miscellaneous files.
It was also confusing to find empty.nupkg files after filtering for *.(s)nukpg after dotnet pack-ing my project, hence why I investigated this (but otherwise, this is a separate issue and can be resolved by the consumer).
Describe the solution
Possibly via a custom msbuild property:
- Simplest way would be a complete feature toggle:
-p:CopyEmptyFiles=false(wheretrueor not specified means copy all) - Alternatively, opt-in to certain file extensions based on the project its needs, f.ex.:
-p:CopyEmptyFilesToOutput=bmp,jpg?
The default behavior would still be to copy all, as currently is the case.
Describe alternatives considered
Is there really even a need to put all these files on disk, all the time, during each build? Could it not be streamed from an embedded resource on demand just before starting a diff tool, for example to a temp file? I am not sure of all the use cases so hard for me to judge.