dotnet_runtime/eng/intellisense.targets

51 lines
3.2 KiB
XML

<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>