Skip to content

Commit

Permalink
Enforce API Compat (Azure#38717)
Browse files Browse the repository at this point in the history
* Enforce running ApiCompat

* Remove runapicompat property from storage extensions

* Add metapackage exclusion

* Only validate that RunApiCompat is not false for specific target

* fix

* temporary test to make sure CI fails

* Use Build step instead of Analyze

* Use parameter

* PR fb
  • Loading branch information
JoshLove-msft authored Sep 15, 2023
1 parent 75ff597 commit 2a42c6a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions eng/Directory.Build.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<Error Condition="'@(RequiredTargetFrameworks)' == ''" Text="List of required target frameworks is empty something must have messed up property RequiredTargetFrameworks[$(RequiredTargetFrameworks)]." />
<Error Condition="'@(MissingTargetFrameworks)' != ''" Text="Missing required target frameworks '@(MissingTargetFrameworks)'. Please ensure you add those frameworks." />
</Target>

<Target Name="ValidateRunApiCompat" BeforeTargets="Build" Condition="'$(ValidateRunApiCompat)' == 'true'">
<Error Condition="'$(RunApiCompat)' == 'false' and '$(IncludeBuildOutput)' != 'false'"
Text="Api Compat cannot be disabled."/>
</Target>

<!-- Set PackageProjectUrl and PackageReleaseNotes to the package README.md and CHANGELOG.md respectively for DataPlane Libraries -->
<Target Name="SetPackageProjectUrlandReleaseNotes" BeforeTargets="GenerateNuspec" DependsOnTargets="InitializeSourceControlInformationFromSourceControlManager" Condition="'$(IsShippingLibrary)' == 'true' and '$(SourceRevisionId)' != ''">
Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/templates/jobs/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
LogFilePath: $(Build.ArtifactStagingDirectory)/pack.binlog
- script: >-
dotnet pack eng/service.proj -warnaserror
/p:ValidateRunApiCompat=true
/p:SDKType=${{ parameters.SDKType }}
/p:ServiceDirectory=${{ parameters.ServiceDirectory }}
/p:IncludeTests=false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<Version>5.3.0-beta.1</Version>
<!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
<ApiCompatVersion>5.2.0</ApiCompatVersion>
<RunApiCompat>false</RunApiCompat>
<Description>This extension adds bindings for Storage</Description>
<!-- https://github.com/Azure/azure-sdk-for-net/issues/19222 -->
<NoWarn>$(NoWarn);IDT002;IDT003</NoWarn>
Expand Down

0 comments on commit 2a42c6a

Please sign in to comment.