Repository navigation
Commit 7f78a35
committed
Hide TestOutputHandler via annotations in AndroidX Test.
Mark `TestOutputHandler` with `@RestrictTo(Scope.LIBRARY)` in
open-source exports (via `copybara:insert`) and with a package-private
internal `@HideFromApi` annotation in google3 so Metalava and Dackka
exclude it without relying on `@hide` Javadoc tags.
In google3, external test harnesses still implement `TestOutputHandler`
(so active `@RestrictTo` triggers ErrorProne `RestrictToEnforcer`), and
package-level filtering cannot be used on
`androidx.test.internal.platform.util` because `TestOutputEmitter` in
the same package is part of `monitor`'s `current_internal.txt`.
Using annotations instead of `@hide` doc tags:
- Unlocks passing `--ignore-comments` on API signature generation,
improving build performance and memory usage by skipping Javadoc/KDoc
comment extraction and AST parsing.
- Enables Metalava declarative `<api-surfaces>` XML configuration,
which ignores `@hide` and `@removed` Javadoc tags by design.
- Enforces `@RestrictTo(Scope.LIBRARY)` statically for external callers.
PiperOrigin-RevId: 10156504861 parent 761fb9e commit 7f78a35
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
0 commit comments