Commit Graph

6 Commits

Author SHA1 Message Date
Anton Hansson
47ff71a902 Convert merged module lib stub to api.go
Bug: 169103987
Test: m framework-updatable-stubs-module_libs_api and diff intermediates
      folder before and after.
Change-Id: I6018791ae136bc764a6e846078c6bce59bcc123b
2022-01-13 15:07:09 +00:00
Anton Hansson
b108f75b9d Some minor tweaks for api.go
- Make constants for re-used hardcoded module names
- Add a removeAll function
- Move filtering into individual "create" methods.

Bug: 169103987
Test: mmm frameworks/base/api
Change-Id: Id81c93eafdbdbbd0f55a4a906150b58a001392f6
2022-01-13 15:04:13 +00:00
Anton Hansson
a8e3488cc3 Temporarily add support for conditional modules
Some bootclasspath libraries are currently conditionally included
in the SDK. Add support for that in api.go.

Bug: 169103987
Test: mmm frameworks/base/api
Change-Id: I7704a884675eb58c429a59f99a663cf09807ecec
2022-01-13 09:48:09 +00:00
Anton Hansson
7a173a626f Construct sdk-annotations.zip programmatically
Avoid hardcoding the list of modules in yet another place.

Bug: 169103987
Test: diff zip before & after (identical)
Change-Id: Id3983bf5f4b96b23b1da09fd3617870ac3926ea1
2022-01-12 14:45:22 +00:00
Anton Hansson
28eda09cf5 Refactor api.go to simplify Android.bp further
The gitlinter tool consumes the Android.bp file and from it mines
the module names of libraries that contribute to the public API surface.
The format required by the previous incarnation of api.go (creating a
list in Android.bp and passing that multiple times) did not lend itself
to being easily consumed by gitlinter.

So, change some of the constructs to simplify the Android.bp definition:
- hardcode a couple of "anomalies" inside the go code instead (which
  modules have only public APIs and what modules should be filtered
  from the lint DB). There's no real benefit to plumb them through the
  Android.bp.
- only pass the list of modules once (this allows inlining the list)

Also change the output filename of the genrules. This makes no practical
difference but does match the existing genrules.

Bug: 169103987
Test: in the followup-change that defines a combined_apis
Change-Id: I6715fa9d24603e3cbb8b09510b64c2bf6bac1f27
2022-01-12 12:27:30 +00:00
Anton Hansson
0860aaf958 Generate genrule modules for merged api txts
Add a soong plugin that can generate the genrule definitions for the
merged api txt files. This will allow removing a lot of duplicated
lists in the Android.bp and simplify adding new modules.

Bug: 169103987
Test: follow-up that uses these rules (branch dependent)
Change-Id: I0c7a9921b7f4c5b74f8b652cb357abf9444ce93f
2022-01-10 16:50:27 +00:00