Set ApiCompatIgnoreTargetPlatformMoniker for packable projects (#87212)
authorViktor Hofer <viktor.hofer@microsoft.com>
Wed, 7 Jun 2023 13:41:42 +0000 (15:41 +0200)
committerGitHub <noreply@github.com>
Wed, 7 Jun 2023 13:41:42 +0000 (15:41 +0200)
Follow-up change on a bugfix/feature in APICompat: https://github.com/dotnet/sdk/commit/b8c07fee1b150d46e5c4229cf1f0d81da20393a5

eng/packaging.targets

index 29291f1c6e6816018cd39f205ba1d117814e4058..3e5f6a9e5828653e6f1723008462be52963e0b0e 100644 (file)
@@ -16,6 +16,8 @@
     <!-- Don't include target platform specific dependencies, since we use the target platform to represent RIDs instead -->
     <IncludeBuildOutput Condition="'$(PackageUsePlatformTargeting)' != 'true' and '$(TargetPlatformIdentifier)' != '' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp'">false</IncludeBuildOutput>
     <SuppressDependenciesWhenPacking Condition="'$(PackageUsePlatformTargeting)' != 'true' and '$(TargetPlatformIdentifier)' != '' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp'">true</SuppressDependenciesWhenPacking>
+    <!-- Don't treat the TPM as an input to APICompat PackageValidation's reference assembly calculation. -->
+    <ApiCompatIgnoreTargetPlatformMoniker Condition="'$(SuppressDependenciesWhenPacking)' == 'true'">true</ApiCompatIgnoreTargetPlatformMoniker>
     <PackageDesignerMarkerFile>$(MSBuildThisFileDirectory)useSharedDesignerContext.txt</PackageDesignerMarkerFile>
     <PackageReadmeFile Condition="'$(PackageReadmeFile)' == '' and Exists('PACKAGE.md')">PACKAGE.md</PackageReadmeFile>
     <!-- Generate packages for rid specific projects or for allconfigurations during build. -->