Skip to content

Commit

Permalink
Fix GetTargetPath hook point (#106553)
Browse files Browse the repository at this point in the history
I noticed that in some environments, the existing hook point (AfterTargets=GetTargetPathWithTargetPlatformMoniker) doesn't work. That resulted in some project compiling against the src instead of the ref assembly.

DependsOnTargets + BeforeTargets="GetTargetPath" is is more correct anyway and works as exected.
  • Loading branch information
ViktorHofer authored Aug 19, 2024
1 parent 418c3b9 commit 0fca85f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion eng/illink.targets
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
<!-- Flow the ILLinkSuppressionsXmls item list down to consuming projects, in order for sfx.proj and oob.proj to
receive the suppression files. -->
<Target Name="AnnotateTargetPathWithILLinkSuppressionsXmlsProp"
AfterTargets="GetTargetPathWithTargetPlatformMoniker">
DependsOnTargets="GetTargetPathWithTargetPlatformMoniker"
BeforeTargets="GetTargetPath">
<ItemGroup>
<TargetPathWithTargetPlatformMoniker ILLinkSuppressionsXmls="@(ILLinkSuppressionsXmls->Metadata('FullPath'))" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions eng/intellisense.targets
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@

<!-- Allow P2Ps to retrieve the DocFileItem path. -->
<Target Name="AnnotateTargetPathWithTargetPlatformMonikerWithDocFileItem"
DependsOnTargets="ChangeDocumentationFileForPackaging"
AfterTargets="GetTargetPathWithTargetPlatformMoniker">
DependsOnTargets="ChangeDocumentationFileForPackaging;GetTargetPathWithTargetPlatformMoniker"
BeforeTargets="GetTargetPath">
<ItemGroup>
<TargetPathWithTargetPlatformMoniker DocFileItem="@(DocFileItem)" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions eng/resolveContract.targets
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
<!-- Allow P2Ps that target a source project to build against the corresponding ref project. -->
<Target Name="AnnotateTargetPathWithTargetPlatformMonikerWithReferenceAssembly"
Condition="'$(AnnotateTargetPathWithContract)' == 'true'"
DependsOnTargets="ResolveProjectReferences"
AfterTargets="GetTargetPathWithTargetPlatformMoniker">
DependsOnTargets="ResolveProjectReferences;GetTargetPathWithTargetPlatformMoniker"
BeforeTargets="GetTargetPath">
<ItemGroup>
<TargetPathWithTargetPlatformMoniker ReferenceAssembly="@(ResolvedMatchingContract)" />
</ItemGroup>
Expand Down

0 comments on commit 0fca85f

Please sign in to comment.