Commit graph

11 commits

Author SHA1 Message Date
Andrew Walbran
fb7566456c Ignore modules which are not exported to Make.
Bug: 323833345
Test: forrest run on git_udc-qpr-dev-plus-aosp/aosp_arm64-trunk_staging-userdebug
Change-Id: I3b190ebc1a1096972d0a1273e490972e04684dd2
2024-02-20 18:13:58 +00:00
Colin Cross
5a37718c95 Convert ModuleProvder to generic providers API
Convert all of the callers of ModuleProvider/ModuleHasProvider to use the
type-safe android.SingletonModuleProvider API.

Bug: 316410648
Test: builds
Change-Id: I6f11638546b64749e451cebbf33140248dc1d193
2023-12-14 16:12:22 -08:00
Colin Cross
402130276c Convert SetProvider to generic providers API
Convert all of the callers of SetProvider to use the type-safe
android.SetProvider API.

Bug: 316410648
Test: builds
Change-Id: If58f4b5355264ddab2045bc3591a4eac19cd58fc
2023-12-14 16:12:20 -08:00
Colin Cross
bc7d76cca2 Convert NewProvider/NewMutatorProvider to generic providers API
Convert all of the callers to NewProvider and NewMutatorProvider
to use a generic type parameter instead of an example object.

Bug: 316410648
Test: builds
Change-Id: Ic9cdafc87336e26730d3fd596df05de0e7267542
2023-12-14 16:12:20 -08:00
Colin Cross
3c0a83d19f Use generics for providers API
Using generics for the providers API allows a type to be associated
with a ProviderKey, resulting in a type-safe API without that doesn't
require runtime type assertions by every caller.

Unfortunately, Go does not allow generic types in methods, only in
functions [1].  This prevents a type-safe API on ModuleContext, and
requires moving the API to be functions that take a ModuleContext as
a parameter.

This CL creates the new API, but doesn't convert all of the callers.

[1] https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#no-parameterized-methods)

Bug: 316410648
Test: builds
Change-Id: I3e30d68b966b730efd968166a38a25cc144bd6de
2023-12-14 16:12:20 -08:00
LaMont Jones
0c10e4dcc0 Parallelize singleton execution
Bug: 281536768
Test: manual, presubmits
Change-Id: I57fdc76ba6b277e88e196b506af87127a530fd37
2023-05-19 20:31:32 +00:00
Thiébaud Weksteen
e4dd14b25f bloaty: measure stripped Rust binaries
Modify bloaty's MeasureSizeForPath to allow a module to provide multiple
paths. This is used to measure both unstripped and stripped
libraries/binaries. Add unit test to ensure correct measurements are
generated for Rust.

Test: m out/soong/binary_sizes.pb.gz
Change-Id: I59439b77dbf1cf5ad71e1c02996a6a90938536b4
2021-04-15 12:02:51 +02:00
Thiébaud Weksteen
85e8bd61c0 Compress the binary_size.pb artifact
Bug: 183934389
Test: m out/soong/binary_sizes.pb.gz
Change-Id: Ib79fd9cd82c7029f3ee409df91697797a8be7d06
2021-04-06 15:10:45 +02:00
Thiébaud Weksteen
55d6b3edbd bloaty: Append new file extension
When measuring the sections of a binary, the file extension of the
output was replaced. Append the new extension instead, to preserve the
full name of the file measured.

Test: m out/soong/binary_sizes.pb
Change-Id: I4c7b5cf1be3bdce858a7cc72f278ddada0425898
2021-03-29 15:34:53 +02:00
Thiébaud Weksteen
5db3d98c3e Enable bloaty artifact for checkbuild
Test: m checkbuild dist; verify DIST_DIR/binary_sizes.pb
Bug: 172339742
Change-Id: If6f3b33a5d6efade98a15ddf5827ef010d1535dd
2021-02-25 10:02:49 +01:00
Thiébaud Weksteen
6d48aad0ff Add bloaty package
This package can be used by other binary generator to gather the section
sizes at build time. It uses bloaty_merger to export all the measured
data into a single proto file.

Bug: 172339742
Test: m out/soong/binary_sizes.pb
Change-Id: I0ca87cdb2fb8b77226e79d9dcd762abe64aeea51
2021-02-18 15:46:14 +01:00