Skip to content

Commit

Permalink
Add ContractDependencyPaths for ApiCompat (#2098)
Browse files Browse the repository at this point in the history
  • Loading branch information
utpilla authored Jun 24, 2021
1 parent 13a48a6 commit b6d4e88
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build/Common.prod.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,25 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(MinVerTagPrefix)' == 'core-' AND '$(CheckAPICompatibility)' == 'true'">
<PackageReference Include="Microsoft.DotNet.ApiCompat" Version="6.0.0-beta.21308.1" PrivateAssets="All" />
<ResolvedMatchingContract Include="..\LastMajorVersionBinaries\$(AssemblyName)\$(OTelPreviousStableVer)\lib\$(TargetFramework)\$(AssemblyName).dll" />
</ItemGroup>

<Target Name="PreBuild" BeforeTargets="PreBuildEvent" Condition="'$(MinVerTagPrefix)' == 'core-' AND '$(CheckAPICompatibility)' == 'true'">
<Exec Command="powershell -ExecutionPolicy Unrestricted -File &quot;$(RepoRoot)\build\PreBuild.ps1&quot; -package $(AssemblyName) -version &quot;$(OTelPreviousStableVer)&quot;" />
</Target>

<Target Name="FindContractDependencyPaths" BeforeTargets="ValidateApiCompatForSrc" AfterTargets="ResolveAssemblyReferences" Condition="'$(MinVerTagPrefix)' == 'core-' AND '$(CheckAPICompatibility)' == 'true'">
<ItemGroup>
<_ReferencePathDirectories Include="@(ReferencePath -> '%(RootDir)%(Directory)')" />
</ItemGroup>
<PropertyGroup>
<ContractDependencyPaths>@(_ReferencePathDirectories->Distinct())</ContractDependencyPaths>
</PropertyGroup>
</Target>

<PropertyGroup>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)/OpenTelemetry.prod.ruleset</CodeAnalysisRuleSet>
<NoWarn>$(NoWarn),1573,1712</NoWarn>
Expand Down

0 comments on commit b6d4e88

Please sign in to comment.