-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 local intellisense xmls for assemblies with source of truth. #79134
Changes from all commits
02e8b58
3227c67
175deee
33d63d8
4cdf926
4785850
27ae4a6
d5cbf96
15ff2cd
4d3633d
74a4b4e
19249f5
83773b7
ba8ac9a
8c39ea9
6197945
4d94daa
80d0d0d
d2a60f9
f4ce3cb
2c7048e
459ce39
2d70d61
c689a05
4d3e550
981d201
dc8ef9a
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<Project InitialTargets="VerifyAssemblySupportsDocsXmlGeneration"> | ||
|
||
<PropertyGroup> | ||
<UseIntellisensePackageDocXmlFile Condition="'$(UseIntellisensePackageDocXmlFile)' == ''">true</UseIntellisensePackageDocXmlFile> | ||
</PropertyGroup> | ||
|
||
<Target Name="VerifyAssemblySupportsDocsXmlGeneration" | ||
Condition="'$(UseIntellisensePackageDocXmlFile)' != 'true'"> | ||
<Error | ||
Condition="'$(IsPartialFacadeAssembly)' == 'true'" | ||
Text="The 'UseIntellisensePackageDocXmlFile' property is not supported for partial facade assemblies: $(AssemblyName)" /> | ||
<Error | ||
Condition="'$(GeneratePlatformNotSupportedAssemblyMessage)' != ''" | ||
Text="The 'UseIntellisensePackageDocXmlFile' property is not supported for assemblies that throw PlatformNotSupportedException: $(AssemblyName)" /> | ||
</Target> | ||
|
||
<PropertyGroup> | ||
<NoWarn Condition="'$(UseIntellisensePackageDocXmlFile)' == 'true'">$(NoWarn);1591</NoWarn> | ||
<IntellisensePackageXmlRootFolder>$([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', 'microsoft.private.intellisense', '$(MicrosoftPrivateIntellisenseVersion)', 'IntellisenseFiles'))</IntellisensePackageXmlRootFolder> | ||
<IntellisensePackageXmlFilePathFromNetFolder>$([MSBuild]::NormalizePath('$(IntellisensePackageXmlRootFolder)', 'net', '1033', '$(AssemblyName).xml'))</IntellisensePackageXmlFilePathFromNetFolder> | ||
<IntellisensePackageXmlFilePathFromDotNetPlatExtFolder>$([MSBuild]::NormalizePath('$(IntellisensePackageXmlRootFolder)', 'dotnet-plat-ext', '1033', '$(AssemblyName).xml'))</IntellisensePackageXmlFilePathFromDotNetPlatExtFolder> | ||
<IntellisensePackageXmlFilePath Condition="'$(UseIntellisensePackageDocXmlFile)' == 'true' and Exists($(IntellisensePackageXmlFilePathFromNetFolder))">$(IntellisensePackageXmlFilePathFromNetFolder)</IntellisensePackageXmlFilePath> | ||
<IntellisensePackageXmlFilePath Condition="'$(IntellisensePackageXmlFilePath)' == '' and '$(UseIntellisensePackageDocXmlFile)' == 'true' and Exists($(IntellisensePackageXmlFilePathFromDotNetPlatExtFolder))">$(IntellisensePackageXmlFilePathFromDotNetPlatExtFolder)</IntellisensePackageXmlFilePath> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageDownload Include="Microsoft.Private.Intellisense" Version="[$(MicrosoftPrivateIntellisenseVersion)]" /> | ||
</ItemGroup> | ||
|
||
<!-- TODO: Remove this target when no library relies on the intellisense documentation file anymore.--> | ||
<!-- Replace the default xml file generated in the obj folder with the one that comes from the docs feed. --> | ||
<Target Name="ChangeDocumentationFileForPackaging" | ||
AfterTargets="DocumentationProjectOutputGroup" | ||
carlossanlop marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Condition="'$(UseIntellisensePackageDocXmlFile)' == 'true'"> | ||
<ItemGroup> | ||
<DocFileItem Remove="@(DocFileItem)" /> | ||
<DocFileItem Include="$(IntellisensePackageXmlFilePath)" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="CopyDocumentationFileToXmlDocDir" | ||
AfterTargets="CopyFilesToOutputDirectory" | ||
Condition="'$(IsNetCoreAppSrc)' == 'true' and '$(TargetFramework)' == '$(NetCoreAppCurrent)'" | ||
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. Just realized that the We should remove that artificial limitation and restore the previous behavior. I could see the following cases to apply:
I don't know if it's possible to determine the third case in an msbuild environment, but that's the default build behavior in dotnet/runtime and will be utilized in the VMR with RID builds. Therefore we should try to make that work. 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. I created an issue to track this: #82191 |
||
DependsOnTargets="ChangeDocumentationFileForPackaging"> | ||
<Copy SourceFiles="@(DocFileItem)" | ||
DestinationFolder="$(XmlDocDir)" | ||
SkipUnchangedFiles="true" | ||
UseHardlinksIfPossible="true" /> | ||
</Target> | ||
|
||
</Project> |
This file was deleted.
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.
As we just discussed, this might be too late to impact the result of a ProjectReference.
ProjectReferences (as used in the transport packages) only recieve the path to the dll in the bin folder and find the doc file relative to that.
To support ProjectReference we may want to swap the value of
@(DocFileItem)
instead and do so right beforeCopyFilesToOutputDirectory
. This will make it so that the "shipping" xml is always next to the binary in the bin folder. The compiler generated one (in the case it is not shipping) will remain in the obj folder.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.
Here's a sample that does this: ericstj@94849ba
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.
Did you verify that this works in a pack-only scenario as well? dotnet pack --no-build
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.
Added some tests in a comment in the main thread.