Skip to content

Commit

Permalink
Move XmlDocFileRoot to intellisense.targets, address suggestions for …
Browse files Browse the repository at this point in the history
…collecting xml file.
  • Loading branch information
carlossanlop committed Jan 20, 2023
1 parent eeb3d22 commit 87ab04e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
1 change: 0 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
<IbcOptimizationDataDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'ibc'))</IbcOptimizationDataDir>
<MibcOptimizationDataDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'mibc'))</MibcOptimizationDataDir>
<XmlDocDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'docs'))</XmlDocDir>
<XmlDocFileRoot>$([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', 'microsoft.private.intellisense', '$(MicrosoftPrivateIntellisenseVersion)', 'IntellisenseFiles'))</XmlDocFileRoot>
<DocsDir>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'docs'))</DocsDir>
<ManPagesDir>$([MSBuild]::NormalizeDirectory('$(DocsDir)', 'manpages'))</ManPagesDir>

Expand Down
23 changes: 16 additions & 7 deletions eng/intellisense.targets
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
<Project>

<PropertyGroup>
<!-- Search for the documentation file in the intellisense package and otherwise pick up the generated one. -->
<IntellisensePackageFolderName Condition="'$(IsPackable)' == '' or '$(IsPackable)' == 'false'">net</IntellisensePackageFolderName>
<IntellisensePackageFolderName Condition="'$(IsPackable)' == 'true'">dotnet-plat-ext</IntellisensePackageFolderName>
<LibIntellisenseDocumentationFilePath Condition="'$(UseIntellisenseDocumentationFile)' == 'true'">$([MSBuild]::NormalizePath('$(ArtifactsBinDir)', '$(MSBuildProjectName)', '$(LibrariesConfiguration)', '$(NetCoreAppCurrent)', '$(MSBuildProjectName).xml'))</LibIntellisenseDocumentationFilePath>
<LibIntellisenseDocumentationFilePath Condition="'$(UseIntellisenseDocumentationFile)' == '' or '$(UseIntellisenseDocumentationFile)' == 'false'">$([MSBuild]::NormalizePath('$(XmlDocFileRoot)', '$(IntellisensePackageFolderName)', '1033', '$(AssemblyName).xml'))</LibIntellisenseDocumentationFilePath>
<UseIntellisenseDocumentationFile Condition="'$(UseIntellisenseDocumentationFile)' == '' and Exists('$(LibIntellisenseDocumentationFilePath)')">true</UseIntellisenseDocumentationFile>
<XmlDocFileRoot>$([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', 'microsoft.private.intellisense', '$(MicrosoftPrivateIntellisenseVersion)', 'IntellisenseFiles'))</XmlDocFileRoot>
</PropertyGroup>

<!-- If the project is not generating its own documentation yet, retrieve it from the dotnet-api-docs nuget package. -->
<Choose>
<When Condition="('$(UseIntellisenseDocumentationFile)' == '' or '$(UseIntellisenseDocumentationFile)' == 'false') and Exists($([MSBuild]::NormalizePath('$(XmlDocFileRoot)', 'net', '1033', '$(AssemblyName).xml')))">
<PropertyGroup>
<IntellisenseFilePath>$([MSBuild]::NormalizePath('$(XmlDocFileRoot)', 'net', '1033', '$(AssemblyName).xml')</IntellisenseFilePath>
</PropertyGroup>
</When>
<When Condition="('$(UseIntellisenseDocumentationFile)' == '' or '$(UseIntellisenseDocumentationFile)' == 'false') and Exists($([MSBuild]::NormalizePath('$(XmlDocFileRoot)', 'dotnet-plat-ext', '1033', '$(AssemblyName).xml')))">
<PropertyGroup>
<IntellisenseFilePath Condition="">$([MSBuild]::NormalizePath('$(XmlDocFileRoot)', 'dotnet-plat-ext', '1033', '$(AssemblyName).xml')</IntellisenseFilePath>
</PropertyGroup>
</When>
</Choose>

<!-- TODO: Remove this target when no library relies on the intellisense documentation file anymore.-->
<Target Name="ChangeDocumentationFileForPackaging"
AfterTargets="DocumentationProjectOutputGroup"
Condition="'$(UseIntellisenseDocumentationFile)' == 'true'">
<ItemGroup>
<DocumentationProjectOutputGroupOutput Remove="@(DocumentationProjectOutputGroupOutput)" />
<DocumentationProjectOutputGroupOutput Include="$(LibIntellisenseDocumentationFilePath)" />
<DocumentationProjectOutputGroupOutput Include="$(IntellisenseFilePath)" />
</ItemGroup>
</Target>

Expand Down

0 comments on commit 87ab04e

Please sign in to comment.