From 0b3703eee9d55e86bf6b3cd7580ec2f6da04b7b9 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com> Date: Wed, 1 Feb 2023 14:29:00 -0800 Subject: [PATCH] Copy local intellisense xmls for assemblies with source of truth. (#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 Co-authored-by: carlossanlop --- Build.proj | 3 -- Directory.Build.props | 1 - eng/intellisense.targets | 51 +++++++++++++++++++ eng/packaging.targets | 14 +---- eng/restore/docs.targets | 46 ----------------- .../Microsoft.NETCore.App.Ref.sfxproj | 2 +- src/libraries/Directory.Build.props | 5 ++ src/libraries/Directory.Build.targets | 1 + .../src/System.Formats.Cbor.csproj | 1 + 9 files changed, 60 insertions(+), 64 deletions(-) create mode 100644 eng/intellisense.targets delete mode 100644 eng/restore/docs.targets diff --git a/Build.proj b/Build.proj index 5f47e869fb6e..baa240685ae5 100644 --- a/Build.proj +++ b/Build.proj @@ -8,9 +8,6 @@ - - - $([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'ibc')) $([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'mibc')) $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'docs')) - $([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', 'microsoft.private.intellisense', '$(MicrosoftPrivateIntellisenseVersion)', 'IntellisenseFiles', 'net')) $([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'docs')) $([MSBuild]::NormalizeDirectory('$(DocsDir)', 'manpages')) diff --git a/eng/intellisense.targets b/eng/intellisense.targets new file mode 100644 index 000000000000..f00dab6e5fc3 --- /dev/null +++ b/eng/intellisense.targets @@ -0,0 +1,51 @@ + + + + true + + + + + + + + + $(NoWarn);1591 + $([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', 'microsoft.private.intellisense', '$(MicrosoftPrivateIntellisenseVersion)', 'IntellisenseFiles')) + $([MSBuild]::NormalizePath('$(IntellisensePackageXmlRootFolder)', 'net', '1033', '$(AssemblyName).xml')) + $([MSBuild]::NormalizePath('$(IntellisensePackageXmlRootFolder)', 'dotnet-plat-ext', '1033', '$(AssemblyName).xml')) + $(IntellisensePackageXmlFilePathFromNetFolder) + $(IntellisensePackageXmlFilePathFromDotNetPlatExtFolder) + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/eng/packaging.targets b/eng/packaging.targets index e5cfa659cfaf..3280c79c475d 100644 --- a/eng/packaging.targets +++ b/eng/packaging.targets @@ -28,9 +28,7 @@ true - - $(XmlDocFileRoot)1033\$(AssemblyName).xml - true + false @@ -108,16 +106,6 @@ ($(TargetFrameworks.Contains('$(NetFrameworkMinimum)')) or $(TargetFrameworks.Contains('net47')) or $(TargetFrameworks.Contains('net48')))" /> - - - - - - - - - - - - - - - - - - $([System.String]::new('%(RecursiveDir)').TrimEnd('\/')) - - - - unknown - zh-hant/ - de/ - - - fr/ - it/ - ja/ - ko/ - ru/ - zh-hans/ - es/ - - - %(Culture)/ - - - - - - - - - - diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Ref.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Ref.sfxproj index f1e52a78e99c..5efeb4c15690 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Ref.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Ref.sfxproj @@ -14,7 +14,7 @@ - + diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index 26a32b81b781..60e1781782a5 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -2,6 +2,11 @@ true true + + true diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index dfd6937366ad..ab2d99f3644f 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -77,6 +77,7 @@ + diff --git a/src/libraries/System.Formats.Cbor/src/System.Formats.Cbor.csproj b/src/libraries/System.Formats.Cbor/src/System.Formats.Cbor.csproj index bb71e12e648e..2e43a07a64d8 100644 --- a/src/libraries/System.Formats.Cbor/src/System.Formats.Cbor.csproj +++ b/src/libraries/System.Formats.Cbor/src/System.Formats.Cbor.csproj @@ -3,6 +3,7 @@ $(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) true true + false Provides classes that can read and write the CBOR data format. Commonly Used Types: