Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade ApiCompat version and remove contract assemblies #1308

Merged
merged 1 commit into from
Jan 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15 changes: 13 additions & 2 deletions build/apiCompat.props
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<Project>
<!-- https://github.com/dotnet/arcade/tree/master/src/Microsoft.DotNet.ApiCompat -->
<PropertyGroup>
<RunApiCompat>false</RunApiCompat>
<RunApiCompatForSrc>true</RunApiCompatForSrc>
<RunMatchingRefApiCompat>false</RunMatchingRefApiCompat>
<ApiCompatEnforceOptionalRules>true</ApiCompatEnforceOptionalRules>
<ApiCompatBaseline>$(SolutionDir)Tools\apiCompat\baseline\ApiCompatBaseline.$(TargetFramework).txt</ApiCompatBaseline>
<ApiCompatExcludeAttributeList>$(SolutionDir)Tools\apiCompat\ApiCompatExcludeAttributeList.txt</ApiCompatExcludeAttributeList>
<AllowMissingContractAssemblies>true</AllowMissingContractAssemblies>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ApiCompat" Version="1.0.0-beta.18557.3" PrivateAssets="All" />
<PackageReference Include="Microsoft.DotNet.ApiCompat" Version="5.0.0-beta.19626.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand All @@ -25,8 +28,16 @@
<Message Importance="High" Text=">>> Running ApiCompat for the assembly: $(TargetFramework)\$(TargetName).dll"/>
</Target>

<Target Name="CheckIfContractAssemblyExists" Condition="'$(RunApiCompat)' == 'true' AND !Exists('@(ResolvedMatchingContract)')" BeforeTargets="ValidateApiCompatForSrc">
<!--
Only warn (don't throw) if a contract assembly is not found. ApiCompat > v5 by default throws if a contract assembly is not found.
Useful when a new assembly/target is introduced and there is no contract assembly available yet.
-->
<Target Name="CheckIfContractAssemblyExists" Condition="'$(RunApiCompat)' == 'true' AND '$(AllowMissingContractAssemblies)' == 'true' AND !Exists('@(ResolvedMatchingContract)')" BeforeTargets="ValidateApiCompatForSrc">
<Warning Text=">>> Contract assembly doesn't exist. ApiCompat will not run for the assembly: @(ResolvedMatchingContract)"/>
<Copy
SourceFiles="$(ProjectDir)$(IntermediateOutputPath)$(TargetFileName)"
DestinationFolder="$(SolutionDir)Tools\apiCompat\contractAssemblies\$(TargetFramework)\"
/>
</Target>

<Target Name="ResolveContractDependencyDirectories" BeforeTargets="ValidateApiCompatForSrc">
Expand Down