Skip to content

Configure AndroidX Test API generation for annotations and - #2527

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
piper_1015474501
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
piper_1015474501

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Configure AndroidX Test API generation for annotations and
--ignore-comments.

Configure Metalava and Dackka in androidx.test to hide internal APIs
via annotations and package filters instead of @hide Javadoc tags,
and enable --ignore-comments on API signature generation.

  • Annotate internal classes missing visibility annotations
    (ProcSummary, DefaultInterceptingActivityFactory,
    InstrumentationParameterUtil, PortForwardingRule.Builder, and
    TestOutputHandler) so API surface checks hide them without relying
    on @hide doc tags.
  • Add --ignore-comments and --hide-annotation entries for
    androidx.annotation.RestrictTo and HideFromApi in
    generate_api.bzl, plus matching hidingAnnotations in dackka.bzl.
  • Add hide_packages / excluded_packages support for
    androidx.test.services.storage while its @RestrictTo annotations
    remain stripped in internal builds, and remove @hide from those
    storage classes.
  • Update espresso and monitor current_public.txt signature files
    for newly hidden @RestrictTo(LIBRARY_GROUP) AIDL interfaces and
    ExposedInstrumentationApi superclass elision.

Using visibility annotations instead of @hide doc tags:

  • Unlocks passing --ignore-comments on API signature generation,
    improving build performance and memory usage by skipping Javadoc/KDoc
    extraction, comment AST parsing, and {@link} import caching.
  • Enables Metalava declarative <api-surfaces> XML configuration,
    which ignores @hide and @removed Javadoc tags by design.
  • Replaces unchecked Javadoc comments with compiler-, Lint-, and
    IDE-enforced @RestrictTo visibility restrictions.

--ignore-comments.

Configure Metalava and Dackka in `androidx.test` to hide internal APIs
via annotations and package filters instead of `@hide` Javadoc tags,
and enable `--ignore-comments` on API signature generation.

- Annotate internal classes missing visibility annotations
  (`ProcSummary`, `DefaultInterceptingActivityFactory`,
  `InstrumentationParameterUtil`, `PortForwardingRule.Builder`, and
  `TestOutputHandler`) so API surface checks hide them without relying
  on `@hide` doc tags.
- Add `--ignore-comments` and `--hide-annotation` entries for
  `androidx.annotation.RestrictTo` and `HideFromApi` in
  `generate_api.bzl`, plus matching `hidingAnnotations` in `dackka.bzl`.
- Add `hide_packages` / `excluded_packages` support for
  `androidx.test.services.storage` while its `@RestrictTo` annotations
  remain stripped in internal builds, and remove `@hide` from those
  storage classes.
- Update `espresso` and `monitor` `current_public.txt` signature files
  for newly hidden `@RestrictTo(LIBRARY_GROUP)` AIDL interfaces and
  `ExposedInstrumentationApi` superclass elision.

Using visibility annotations instead of `@hide` doc tags:
- Unlocks passing `--ignore-comments` on API signature generation,
  improving build performance and memory usage by skipping Javadoc/KDoc
  extraction, comment AST parsing, and `{@link}` import caching.
- Enables Metalava declarative `<api-surfaces>` XML configuration,
  which ignores `@hide` and `@removed` Javadoc tags by design.
- Replaces unchecked Javadoc comments with compiler-, Lint-, and
  IDE-enforced `@RestrictTo` visibility restrictions.

PiperOrigin-RevId: 1015474501
@copybara-service copybara-service Bot changed the title Replace @hide doc tags in AndroidX Test and enable --ignore-comments. Configure AndroidX Test API generation for annotations and Nov 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant