Control the Publish Reference files copy behavior
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
### Summary
More precise control over files copied to the publish directory.
### Background and Motivation
When publishing plugin project, need to minimize the size, but include necessary files (many files already exist in the load environment), but currently, must be deleted the redundant files from the publish directory after publication.
This incurs unnecessary additional disk IO costs and publishing time(), and may also wasted time if deleted the necessary files accidentlly.
(In my case, it's over 200MB, 600+ dependency files, but they don't need to be released in folder at all.)
Controlling the actual copy to the publish directory based on project and package boundaries would be a very useful feature.
### Proposed Feature
Currently, the following features are considered for support:
0. Publish all (default behavior)
```xml
All
```
1. Publish current project files only (excluding all dependencies)
```xml
Self
```
2. Publish current project files and direct package references (excluding project references)
```xml
Self;DirectReferencedPackage
```
3. Exclude files in the reference chain from the publish (add the attribute `ExcludeInPublishCopy="true"` to `ProjectReference` and `PackageReference`)
```xml
```
4. Cut off the files in reference chain from the publish (add the list to `PackageReference`, exclude those transitive reference and belows packages from publish coping)
```xml
ThePackageName1;ThePackageName2
```
### Alternative Designs
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.