Open
Description
Part 1 - Use RestrictTo annotations
If we have public
methods that are only meant to be called by other Firebase libraries (like things in common
or core
) we should annotate them with RestrictTo(Scope.LIBRARY_GROUP)
.
https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope
Part 2 - Add a lint check
Any public
method or class in our SDKs should be annotated with one of these three annotations:
PublicApi
- actually meant to be used by 3p developersRestricTo(Scope....)
- only meant to be used by usVisibleForTesting
- not a great idea, but sometimes you need this one
Part 3 - Abort on error
We should clean up all existing violations in the codebase and then add lintOptions { abortOnError true }
so that we cannot footgun ourselves anymore.