-
Notifications
You must be signed in to change notification settings - Fork 484
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
Improve docs on pack's CopyToOutput and Flatten #3274
base: main
Are you sure you want to change the base?
Conversation
Learn Build status updates of commit 6d8804f: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
| PackageCopyToOutput | The file's `CopyToOutput` item metadata will be set the specified value in the project using the package. | | ||
| PackageFlatten | The file's `Flatten` item metadata will be set to the specified value in the project using the package. | |
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.
I'd love to link to some docs where customers can learn more about CopyToOutput and Flatten, but I can't find any Does anyone know where these are documented?
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.
Rainer pointed me to CopyToOutputDirectory
documented on https://learn.microsoft.com/en-us/visualstudio/msbuild/common-msbuild-project-items?view=vs-2022
I guess this is what PackageCopyToOutput
sets, but since the NuGet name is missing Directory
I feel like it's something we need to validate.
I still haven't found docs on Flatten
though.
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.
I'd add BuildAction here.
In general, the BuildAction defaults to the item type.
|
||
As described in the section on [including content in your package](#including-content-in-a-package), there is certain [item metadata](/visualstudio/msbuild/msbuild-items#item-metadata) that can be added to [MSBuild items](/visualstudio/msbuild/msbuild-items), which pack will use. | ||
|
||
| Metadata | Description | |
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.
I believe the nuspec allows files under contentFiles/
to set whatever item type they want, for example, you could have contentFiles/cs/any/stuff.cs
and make it a <Compile
item, not <Content
.
@nkolev92 do you remember how to specify this? I didn't have much of a search yet, so if you don't know, don't waste time looking for it yourself, I'm just hoping you can save me some time 😁
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.
BuildAction
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.
| Metadata | Description | | ||
|:--|:--| | ||
| Pack | The file that this item represents should be included in the package. For items of type `Content` this defaults to the value of the `IncludeContentInPack` property. For all other item types, this defaults to `false`. | | ||
| PackagePath | The path within the package that the file will be located. For items of type `Content`, this defaults to `content\;contentFiles\any\any\`. For all other items types, there is no default value. | |
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.
I'm too lazy to edit the PR right now, but I think it would be worthwhile mentioning that this metadata allows package authors to put any file in any location in the package, even ones that are not part of any NuGet convention.
No description provided.