JuulLabs / able

Able: Android Bluetooth Low Energy library
Apache License 2.0
160 stars 11 forks source link

Add binary compatibility validator #56

Closed twyatt closed 4 years ago

twyatt commented 4 years ago

Fixes #40.

Use binary-compatibility-validator for validating binary compatibility between releases.

codecov[bot] commented 4 years ago

Codecov Report

Merging #56 into develop will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop      #56   +/-   ##
==========================================
  Coverage      83.23%   83.23%           
  Complexity        57       57           
==========================================
  Files             14       14           
  Lines            352      352           
  Branches          34       34           
==========================================
  Hits             293      293           
  Misses            48       48           
  Partials          11       11           
twyatt commented 4 years ago

Are the *.api files autogenerated?

They are generated via ./gradlew apiDump (task provided by binary-compatibility-validator).

After you commit the *.api you can easily make code changes and see how your API changed by re-running ./gradlew apiDump and looking at the diff in git. 😄

./gradlew apiCheck fails if your API differs from the existing *.api files. It's not a feature rich as japicmp in that it will fail for any change, not just incompatible changes. It's up to the maintainer to determine if the change warrants a version bump.

twyatt commented 4 years ago

I especially like this approach as I examine the *.api files and realized that I had some of the logging methods exposed on the public API.

Makes it easy to evaluate how your public API surface looks.