xref: /aosp_15_r20/tools/metalava/USAGE.md (revision 115816f9299ab6ddd6b9673b81f34e707f6bacab)
1*115816f9SAndroid Build Coastguard Worker# Metalava usage by clients
2*115816f9SAndroid Build Coastguard Worker
3*115816f9SAndroid Build Coastguard WorkerThis doc lists out known usages of Metalava with specific features used by each user. The main users are Android
4*115816f9SAndroid Build Coastguard Workerplatform and AndroidX libraries.
5*115816f9SAndroid Build Coastguard Worker
6*115816f9SAndroid Build Coastguard Worker## Features used by both androidx and Android platform
7*115816f9SAndroid Build Coastguard Worker- Signature generation of `*.txt` e.g. `current.txt` (`--api`)
8*115816f9SAndroid Build Coastguard Worker- API change compatibility checking of current API vs previous version txt (`--check-compatibility:api:released`)
9*115816f9SAndroid Build Coastguard Worker- API lint for compliance with [Android API guidelines](https://s.android.com/api-guidelines) (`--api-lint`)
10*115816f9SAndroid Build Coastguard Worker
11*115816f9SAndroid Build Coastguard Worker## Features used exclusively by androidx
12*115816f9SAndroid Build Coastguard Worker- Kotlin sources as inputs
13*115816f9SAndroid Build Coastguard Worker
14*115816f9SAndroid Build Coastguard Worker## Features used exclusively by Android platform
15*115816f9SAndroid Build Coastguard Worker- Support for partial signature files (opposite of `--show-unannotated`) where `@SystemApi` txt file omits public APIs
16*115816f9SAndroid Build Coastguard Worker- Java stubs for jar generation (`--stubs`) for generating android.jar, etc for SDK
17*115816f9SAndroid Build Coastguard Worker- Java stubs for docs generation (`--doc-stubs`) for passing to documentation tools
18*115816f9SAndroid Build Coastguard Worker- Documentation stub enhancement (`--enhance-documentation`)
19*115816f9SAndroid Build Coastguard Worker- Injecting `added in API level` into documentation stubs (`--apply-api-levels`)
20*115816f9SAndroid Build Coastguard Worker- Generating API levels information for documentation and SDK (`--generate-api-levels`)
21*115816f9SAndroid Build Coastguard Worker- Documentation rewriting for documentation stubs (`--replace-documentation`) used by libcore
22*115816f9SAndroid Build Coastguard Worker- Rewriting of nullness annotations to @RecentlyNull/NonNull (`--migrate-nullness`,
23*115816f9SAndroid Build Coastguard Worker`--force-convert-to-warning-nullability-annotations`) for SDK
24*115816f9SAndroid Build Coastguard Worker- Tracking @removed APIs (`--removed-api`)
25*115816f9SAndroid Build Coastguard Worker- DEX API signature generation (`signature-to-dex`) for hidden API enforcement
26*115816f9SAndroid Build Coastguard Worker- XML API signature generation (`--api-xml`) for CTS tests and test coverage infrastructure
27*115816f9SAndroid Build Coastguard Worker- Annotation include, exclude, rewrite, passthrough in stubs (`--include-annotations`, `--exclude-all-annotations`,
28*115816f9SAndroid Build Coastguard Worker`--pass-through-annotation`, `--exclude-annotation`)
29*115816f9SAndroid Build Coastguard Worker- Annotation extraction (`--extract-annotations`, `--copy-annotations`) for generating the SDK
30*115816f9SAndroid Build Coastguard Worker- Generating SDK metadata (`--sdk-`values`)
31