Skip to content

Commit

Permalink
Run APICompat against the previous release of NETCoreApp (#33300)
Browse files Browse the repository at this point in the history
* Run APICompat against the previous release of NETCoreApp

* Remove redundant source build condition

* Add APICompat specific attribute exclusion list.

* Update to latest ApiCompat
  • Loading branch information
ericstj authored Mar 12, 2020
1 parent 1b783e6 commit a675e1c
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 5 deletions.
1 change: 1 addition & 0 deletions eng/ApiCompatExcludeAttributes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
T:System.CLSCompliantAttribute
1 change: 1 addition & 0 deletions eng/DefaultGenApiDocIds.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ T:System.Runtime.CompilerServices.NullableAttribute
T:System.Runtime.CompilerServices.NullableContextAttribute
T:System.Runtime.CompilerServices.PreserveDependencyAttribute
T:System.Runtime.CompilerServices.TypeForwardedFromAttribute
T:System.Runtime.ConstrainedExecution.PrePrepareMethodAttribute
T:System.Runtime.ConstrainedExecution.ReliabilityContractAttribute
T:System.Runtime.InteropServices.ClassInterfaceAttribute
T:System.Runtime.InteropServices.ComDefaultInterfaceAttribute
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</ItemGroup>
<PropertyGroup>
<!-- Arcade dependencies -->
<MicrosoftDotNetApiCompatVersion>5.0.0-beta.20160.4</MicrosoftDotNetApiCompatVersion>
<MicrosoftDotNetApiCompatVersion>5.0.0-beta.20161.5</MicrosoftDotNetApiCompatVersion>
<MicrosoftDotNetBuildTasksFeedVersion>5.0.0-beta.20160.4</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetCodeAnalysisVersion>5.0.0-beta.20160.4</MicrosoftDotNetCodeAnalysisVersion>
<MicrosoftDotNetGenAPIVersion>5.0.0-beta.20160.4</MicrosoftDotNetGenAPIVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<PropertyGroup>
<RunApiCompatForSrc>$(IsSourceProject)</RunApiCompatForSrc>
<RunMatchingRefApiCompat>$(IsSourceProject)</RunMatchingRefApiCompat>
<ApiCompatExcludeAttributeList>$(RepositoryEngineeringDir)DefaultGenApiDocIds.txt</ApiCompatExcludeAttributeList>
<ApiCompatExcludeAttributeList>$(RepositoryEngineeringDir)DefaultGenApiDocIds.txt,$(RepositoryEngineeringDir)ApiCompatExcludeAttributes.txt</ApiCompatExcludeAttributeList>
</PropertyGroup>

<PropertyGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/libraries/restore/dirs.proj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<ItemGroup>
<Project Condition="'$(DotNetBuildFromSource)' != 'true'" Include="analyzers/analyzers.depproj" />

<!-- Build for all configurations -->
<Project Condition="'$(BuildAllConfigurations)' == 'true'" Include="netcoreapp/netcoreapp.depproj" />
<Project Condition="'$(DotNetBuildFromSource)' != 'true'" Include="netcoreapp/netcoreapp.depproj" />
<Project Include="netstandard/netstandard.depproj" />
<Project Include="netfx/netfx.depproj" />
<Project Include="tools/tools.depproj" />
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/restore/netcoreapp/netcoreapp.depproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<NuGetDeploySourceItem>Reference</NuGetDeploySourceItem>
<DisableImplicitFrameworkReferences>false</DisableImplicitFrameworkReferences>
<BinPlaceRef>true</BinPlaceRef>
<TargetFrameworks>netcoreapp2.0;netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>

<ItemGroup Condition="$(TargetFramework.StartsWith('netcoreapp2.'))">
Expand Down
19 changes: 19 additions & 0 deletions src/libraries/shims/ApiCompat.proj
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,26 @@
</Exec>

<Error Condition="'$(ApiCompatExitCode)' != '0'" Text="ApiCompat failed comparing netstandard to $(ApiCompatTarget)" />

<PropertyGroup>
<PreviousNetCoreApp>netcoreapp3.1</PreviousNetCoreApp>
<PreviousNetCoreAppRefPath>$([MSBuild]::NormalizeDirectory('$(RefRootPath)', '$(PreviousNetCoreApp)'))</PreviousNetCoreAppRefPath>
<_previousNetCoreAppBaselineFile>$(MSBuildThisFileDirectory)ApiCompatBaseline.PreviousNetCoreApp.txt</_previousNetCoreAppBaselineFile>
<_previousNetCoreAppBaselineParam>--baseline &quot;$(_previousNetCoreAppBaselineFile)&quot;</_previousNetCoreAppBaselineParam>
<_previousNetCoreAppBaselineParam Condition="'$(UpdatePreviousNetCoreAppBaseline)' == 'true'">&gt; &quot;$(_previousNetCoreAppBaselineFile)&quot;</_previousNetCoreAppBaselineParam>
</PropertyGroup>

<Error Condition="'$(NetCoreAppCurrent)' != 'netcoreapp5.0'" Text="Update value of PreviousNetCoreApp" />
<Error Condition="!Exists($(PreviousNetCoreAppRefPath))" Text="Missing reference assemblies for '$(PreviousNetCoreApp)'" />
<Exec Command="$(_ApiCompatCommand) &quot;$(PreviousNetCoreAppRefPath.TrimEnd('\/'))&quot; @&quot;$(ApiCompatResponseFile)&quot; $(_previousNetCoreAppBaselineParam)"
CustomErrorRegularExpression="^[a-zA-Z]+ :"
StandardOutputImportance="Low"
IgnoreExitCode="true"
>
<Output TaskParameter="ExitCode" PropertyName="ApiCompatExitCode" />
</Exec>

<Error Condition="'$(ApiCompatExitCode)' != '0'" Text="ApiCompat failed comparing $(PreviousNetCoreApp) to $(ApiCompatTarget)" />
</Target>

<Target Name="Build" DependsOnTargets="RunApiCompat" />
Expand Down
23 changes: 23 additions & 0 deletions src/libraries/shims/ApiCompatBaseline.PreviousNetCoreApp.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Compat issues with assembly netstandard:
CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' exists on 'System.ComponentModel.BackgroundWorker.WorkerReportsProgress' in the contract but not the implementation.
CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' exists on 'System.ComponentModel.BackgroundWorker.WorkerSupportsCancellation' in the contract but not the implementation.
CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' exists on 'System.Diagnostics.Process.EnableRaisingEvents' in the contract but not the implementation.
CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' exists on 'System.Diagnostics.ProcessStartInfo.Environment' in the contract but not the implementation.
CannotChangeAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' on 'System.Diagnostics.ProcessStartInfo.Verb' changed from '[DefaultValueAttribute(null)]' in the contract to '[DefaultValueAttribute("")]' in the implementation.
CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' exists on 'System.Diagnostics.ProcessStartInfo.WindowStyle' in the contract but not the implementation.
Compat issues with assembly System:
CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' exists on 'System.ComponentModel.BackgroundWorker.WorkerReportsProgress' in the contract but not the implementation.
CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' exists on 'System.ComponentModel.BackgroundWorker.WorkerSupportsCancellation' in the contract but not the implementation.
CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' exists on 'System.Diagnostics.Process.EnableRaisingEvents' in the contract but not the implementation.
CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' exists on 'System.Diagnostics.ProcessStartInfo.Environment' in the contract but not the implementation.
CannotChangeAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' on 'System.Diagnostics.ProcessStartInfo.Verb' changed from '[DefaultValueAttribute(null)]' in the contract to '[DefaultValueAttribute("")]' in the implementation.
CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' exists on 'System.Diagnostics.ProcessStartInfo.WindowStyle' in the contract but not the implementation.
Compat issues with assembly System.ComponentModel.EventBasedAsync:
CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' exists on 'System.ComponentModel.BackgroundWorker.WorkerReportsProgress' in the contract but not the implementation.
CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' exists on 'System.ComponentModel.BackgroundWorker.WorkerSupportsCancellation' in the contract but not the implementation.
Compat issues with assembly System.Diagnostics.Process:
CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' exists on 'System.Diagnostics.Process.EnableRaisingEvents' in the contract but not the implementation.
CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' exists on 'System.Diagnostics.ProcessStartInfo.Environment' in the contract but not the implementation.
CannotChangeAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' on 'System.Diagnostics.ProcessStartInfo.Verb' changed from '[DefaultValueAttribute(null)]' in the contract to '[DefaultValueAttribute("")]' in the implementation.
CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultValueAttribute' exists on 'System.Diagnostics.ProcessStartInfo.WindowStyle' in the contract but not the implementation.
Total Issues: 18

0 comments on commit a675e1c

Please sign in to comment.