Skip to content

Commit 759d9ad

Browse files
committed
Add ApiCompat run
1 parent e6af4bf commit 759d9ad

6 files changed

+19
-1
lines changed

Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
<IsReferenceAssemblyProject>false</IsReferenceAssemblyProject>
1313
<IsReferenceAssemblyProject Condition="$(MSBuildProjectDirectory.EndsWith('ref'))">true</IsReferenceAssemblyProject>
14-
<OutDirName Condition="'$(IsReferenceAssemblyProject)' == 'true'">$(MSBuildProjectName)-ref</OutDirName>
14+
<RefOutDirName>$(MSBuildProjectName)-ref</RefOutDirName>
15+
<OutDirName Condition="'$(IsReferenceAssemblyProject)' == 'true'">$(RefOutDirName)</OutDirName>
1516

1617
<IsBenchmarkProject Condition="$(MSBuildProjectName.EndsWith('.Performance')) OR $(RepoRelativeProjectDir.Contains('perf'))">true</IsBenchmarkProject>
1718
<IsSpecificationTestProject Condition="$(MSBuildProjectName.EndsWith('.Specification.Tests'))">true</IsSpecificationTestProject>

Directory.Build.targets

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@
115115
<AssemblyVersion>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).0.0</AssemblyVersion>
116116
</PropertyGroup>
117117

118+
<PropertyGroup Label="APICompat settings">
119+
<!-- Don't run APICompat on projects without ref assemblies -->
120+
<RunApiCompat Condition="'$(HasReferenceAssembly)' == 'false'">false</RunApiCompat>
121+
<ContractDir Condition="'$(HasReferenceAssembly)' == 'true'">$(OutputPath.Replace('$(OutDirName)','$(RefOutDirName)'))</ContractDir>
122+
</PropertyGroup>
123+
124+
<ItemGroup Condition="'$(HasReferenceAssembly)' == 'true'">
125+
<ResolvedMatchingContract Include="$(ContractDir)$(TargetFileName)" />
126+
</ItemGroup>
127+
118128
<ItemGroup>
119129
<KnownFrameworkReference Update="Microsoft.NETCore.App">
120130
<!-- Always update the 'latest version', whether the repo is servicing or not. -->

eng/Dependencies.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ and are generated based on the last package release.
2828
<LatestPackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisCSharpPackageVersion)" />
2929
<LatestPackageReference Include="Microsoft.CodeAnalysis.Razor" Version="$(MicrosoftCodeAnalysisRazorPackageVersion)" />
3030
<LatestPackageReference Include="Microsoft.CSharp" Version="$(MicrosoftCSharpPackageVersion)" />
31+
<LatestPackageReference Include="Microsoft.DotNet.APICompat" Version="$(MicrosoftDotNetAPICompatPackageVersion)" />
3132
<LatestPackageReference Include="Microsoft.DotNet.GenAPI" Version="$(MicrosoftDotNetGenApiPackageVersion)" />
3233
<LatestPackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="$(MicrosoftDotNetPlatformAbstractionsPackageVersion)" />
3334
<LatestPackageReference Include="Microsoft.Extensions.ActivatorUtilities.Sources" Version="$(MicrosoftExtensionsActivatorUtilitiesSourcesPackageVersion)" />

eng/Version.Details.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,10 @@
417417
<Uri>https://github.com/aspnet/Extensions</Uri>
418418
<Sha>d40e21ccc14908a054b2181b1d6aeb22c49c630d</Sha>
419419
</Dependency>
420+
<Dependency Name="Microsoft.DotNet.APICompat" Version="1.0.0-beta.19607.3">
421+
<Uri>https://github.com/dotnet/arcade</Uri>
422+
<Sha>4d80b9cfa53e309c8f685abff3512f60c3d8a3d1</Sha>
423+
</Dependency>
420424
<Dependency Name="Microsoft.DotNet.GenAPI" Version="1.0.0-beta.19607.3">
421425
<Uri>https://github.com/dotnet/arcade</Uri>
422426
<Sha>4d80b9cfa53e309c8f685abff3512f60c3d8a3d1</Sha>

eng/Versions.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
<PropertyGroup Label="Automated">
6464
<!-- Packages from dotnet/arcade -->
6565
<MicrosoftDotNetGenAPIPackageVersion>1.0.0-beta.19607.3</MicrosoftDotNetGenAPIPackageVersion>
66+
<MicrosoftDotNetAPICompatPackageVersion>1.0.0-beta.19607.3</MicrosoftDotNetAPICompatPackageVersion>
6667
<!-- Packages from dotnet/roslyn -->
6768
<MicrosoftNetCompilersToolsetPackageVersion>3.4.0-beta4-19569-03</MicrosoftNetCompilersToolsetPackageVersion>
6869
<!-- Packages from dotnet/core-setup -->

eng/targets/CSharp.Common.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<PackageReference Include="MicroBuild.Core" Version="0.3.0" PrivateAssets="All" AllowExplicitReference="true" ExcludeAssets="All" />
1313

1414
<PackageReference Condition="'$(DotNetBuildFromSource)' != 'true'" Include="Microsoft.DotNet.GenAPI" PrivateAssets="All" Version="$(MicrosoftDotNetGenApiPackageVersion)" IsImplicitlyDefined="true" />
15+
<PackageReference Condition="'$(DotNetBuildFromSource)' != 'true'" Include="Microsoft.DotNet.APICompat" PrivateAssets="All" Version="$(MicrosoftDotNetAPICompatPackageVersion)" IsImplicitlyDefined="true" />
1516
</ItemGroup>
1617

1718
<ItemGroup Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' OR '$(RazorSdkCurrentVersionProps)' != ''">

0 commit comments

Comments
 (0)