Skip to content

Commit

Permalink
Fix intellisense package xml file failing up-to-date check in libs pr…
Browse files Browse the repository at this point in the history
…ojects (dotnet#105243)

Fixes dotnet#92940
  • Loading branch information
ViktorHofer authored Jul 23, 2024
1 parent e2a3511 commit 9477e94
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion eng/intellisense.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<IntellisensePackageXmlFilePath Condition="'$(IntellisensePackageXmlFilePath)' == '' and Exists($(IntellisensePackageXmlFilePathFromNetFolder))">$(IntellisensePackageXmlFilePathFromNetFolder)</IntellisensePackageXmlFilePath>
<IntellisensePackageXmlFilePath Condition="'$(IntellisensePackageXmlFilePath)' == '' and Exists($(IntellisensePackageXmlFilePathFromDotNetPlatExtFolder))">$(IntellisensePackageXmlFilePathFromDotNetPlatExtFolder)</IntellisensePackageXmlFilePath>

<IntermediateDocFileItemFromIntellisensePackage>$(IntermediateOutputPath)$(TargetName).intellisense-package.xml</IntermediateDocFileItemFromIntellisensePackage>

<!-- Suppress "CS1591 - Missing XML comment for publicly visible type or member" compiler errors when the intellisense package xml file is used. -->
<NoWarn Condition="'$(SkipIntellisenseNoWarnCS1591)' != 'true'">$(NoWarn);1591</NoWarn>
</PropertyGroup>
Expand All @@ -25,13 +27,26 @@
<PackageDownload Include="Microsoft.Private.Intellisense" Version="[$(MicrosoftPrivateIntellisenseVersion)]" />
</ItemGroup>

<!-- Prepare the intellisense package xml file by copying it to the project's intermediate folder and update its file timestamp.
This is necessary so that all project outputs are newer than all project inputs. Directly copying from the intellisense package
would violate that and break fast up-to-date check. -->
<Target Name="PrepareIntellisensePackageXmlFile"
Inputs="$(IntellisensePackageXmlFilePath)"
Outputs="$(IntermediateDocFileItemFromIntellisensePackage)">
<Copy SourceFiles="$(IntellisensePackageXmlFilePath)"
DestinationFiles="$(IntermediateDocFileItemFromIntellisensePackage)" />

<Touch Files="$(IntermediateDocFileItemFromIntellisensePackage)" />
</Target>

<!-- Replace the compiler generated xml file in the obj folder with the one that comes from the intellisense package. -->
<Target Name="ChangeDocumentationFileForPackaging"
DependsOnTargets="PrepareIntellisensePackageXmlFile"
BeforeTargets="CopyFilesToOutputDirectory;DocumentationProjectOutputGroup"
Condition="'$(UseCompilerGeneratedDocXmlFile)' != 'true' and '$(IntellisensePackageXmlFilePath)' != ''">
<ItemGroup>
<DocFileItem Remove="@(DocFileItem)" />
<DocFileItem Include="$(IntellisensePackageXmlFilePath)" />
<DocFileItem Include="$(IntermediateDocFileItemFromIntellisensePackage)" />
</ItemGroup>
</Target>

Expand Down

0 comments on commit 9477e94

Please sign in to comment.