mirror of
https://github.com/uber/RIBs.git
synced 2026-05-17 12:50:36 +00:00
adc3b0df53
For accessing internal declarations from other modules (e.g. access `rib-base` internals from `rib-test`), we are currently suppressing compiler errors with `@file:Suppress("invisible_reference", "invisible_member")`
A better approach is to:
1. Create an `internal` opt-in annotation.
2. Make the "accessible to friend modules" component `public`
3. Mark the (now public) component with the opt-in annotation.
4. Opt-in to the annotation from `build.gradle`.
Because the new annotation is `internal`, it cannot be normally accessed from external modules. But Gradle can see it if it's part of the source set.
This makes the internal visibility of those friend-modules APIs even stricter, since consumers now cannot just suppress `"invisible_reference"` and `"invisible_member"` to directly access the friend-module API. Plus, we get rid of the hacky suppressions in our codebase.