forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy local intellisense xmls for assemblies with source of truth. (do…
…tnet#79134) * Copy local intellisense xmls for assemblies with source of truth. * use UseIntellisenseDocumentationFile instead * Create intellisense.targets, which contains the Target that defines the set of files to copy, and the Target that copies each of those files into the artifacts/bin/docs folder. The paths of the files to copy are dynamically defined depending if the assembly IsPackable property is set or not, and if the UseIntellisenseDocumentationFile boolean is set or not. * Set UseIntellisenseDocumentationFile to true for the 3 assemblies that already have their source of truth in triple slash. * Delete docs.targets, move package download to Build.proj * Consume $(XmlDocDir) in Microsoft.NetCore.App.Ref.sfxproj * Change condition to import intellisense.targets: Use $(IsSourceProject) == true * Move XmlDocFileRoot to intellisense.targets, address suggestions for collecting xml file. * Expand condition of CopyDocumentationFileToXmlDocDir to also check if IsNetCoreAppSrc == true. * Change AfterTargets of CopyDocumentationFileToXmlDocDir from CoreCompile to CopyFilesToOutputDirectory * Move PackageDownload to intellisense.targets * Remove Choose+When. Readjust properties for Private.Intellisense files/folders. Fix conditions for doc file swap. * Rename csproj property to something more clear. * Default csproj property to true. * Missed adding the "not previously set" condition for UseIntellisensePackageDocXmlFile in intellisense.targets. * Remove incorrect condition in CopyDocumentationFileToXmlDocDir. * Missed property reuse in Condition in sfxproj * Only evaluate second IntellisensePackageXmlFile if the first one did not acquire any value. * Move intellisense.targets import from root to libraries, right after the IsNetCoreAppSrc property is declared so we can use it. * Enable CS1591, skip arcade warning * Move SkipArcadeNoWarnCS1591 to src/libraries/Directory.Build.props to avoid coreclr failures * Remove unnecessary slashes in sfxproj * Move SkipArcadeNoWarn up to the top of src/libraries/Directory.Build.props to ensure it gets loaded before importing arcade. * Revert Brotli and Vectors csproj changes. Those assemblies are either a partial facade or use PNSE. * Add target to intellisense.targets that runs as InitialTarget of the current project, and throws errors if the UseIntellisensePackageDocXmlFile is set to false and the assembly is either a partial facade or uses PNSE. * Improve error message: Mention the problematic property and the offending assembly. * Added extra condition to verification target to only run when UseIntellisense... is not set to true. Also moved the initial definition to its own solitary property group right before the verification target runs. Rename the properties that acquire the value of a file path to "FilePath" instead of just "File", for clarity. --------- Co-authored-by: smasher164 <[email protected]> Co-authored-by: carlossanlop <[email protected]>
- Loading branch information
1 parent
58176f5
commit 0b3703e
Showing
9 changed files
with
60 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
Condition="'$(UseIntellisensePackageDocXmlFile)' == 'true'"> | ||
<ItemGroup> | ||
<DocFileItem Remove="@(DocFileItem)" /> | ||
<DocFileItem Include="$(IntellisensePackageXmlFilePath)" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="CopyDocumentationFileToXmlDocDir" | ||
AfterTargets="CopyFilesToOutputDirectory" | ||
Condition="'$(IsNetCoreAppSrc)' == 'true' and '$(TargetFramework)' == '$(NetCoreAppCurrent)'" | ||
DependsOnTargets="ChangeDocumentationFileForPackaging"> | ||
<Copy SourceFiles="@(DocFileItem)" | ||
DestinationFolder="$(XmlDocDir)" | ||
SkipUnchangedFiles="true" | ||
UseHardlinksIfPossible="true" /> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters