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
This commit is contained in:
Colin Cross
2023-12-12 16:39:03 -08:00
parent 3c0a83d19f
commit bc7d76cca2
27 changed files with 44 additions and 42 deletions

View File

@@ -43,7 +43,7 @@ type FdoProfileInfo struct {
}
// FdoProfileProvider is used to provide path to an fdo profile
var FdoProfileProvider = blueprint.NewMutatorProvider(FdoProfileInfo{}, "fdo_profile")
var FdoProfileProvider = blueprint.NewMutatorProvider[FdoProfileInfo]("fdo_profile")
// FdoProfileMutatorInterface is the interface implemented by fdo_profile module type
// module types that can depend on an fdo_profile module

View File

@@ -368,7 +368,7 @@ type SharedLibraryInfo struct {
TransitiveStaticLibrariesForOrdering *android.DepSet[android.Path]
}
var SharedLibraryInfoProvider = blueprint.NewProvider(SharedLibraryInfo{})
var SharedLibraryInfoProvider = blueprint.NewProvider[SharedLibraryInfo]()
// SharedStubLibrary is a struct containing information about a stub shared library.
// Stub libraries are used for cross-APEX dependencies; when a library is to depend on a shared
@@ -391,7 +391,7 @@ type SharedLibraryStubsInfo struct {
IsLLNDK bool
}
var SharedLibraryStubsProvider = blueprint.NewProvider(SharedLibraryStubsInfo{})
var SharedLibraryStubsProvider = blueprint.NewProvider[SharedLibraryStubsInfo]()
// StaticLibraryInfo is a provider to propagate information about a static C++ library.
type StaticLibraryInfo struct {
@@ -410,14 +410,14 @@ type StaticLibraryInfo struct {
TransitiveStaticLibrariesForOrdering *android.DepSet[android.Path]
}
var StaticLibraryInfoProvider = blueprint.NewProvider(StaticLibraryInfo{})
var StaticLibraryInfoProvider = blueprint.NewProvider[StaticLibraryInfo]()
// HeaderLibraryInfo is a marker provider that identifies a module as a header library.
type HeaderLibraryInfo struct {
}
// HeaderLibraryInfoProvider is a marker provider that identifies a module as a header library.
var HeaderLibraryInfoProvider = blueprint.NewProvider(HeaderLibraryInfo{})
var HeaderLibraryInfoProvider = blueprint.NewProvider[HeaderLibraryInfo]()
// FlagExporterInfo is a provider to propagate transitive library information
// pertaining to exported include paths and flags.
@@ -429,4 +429,4 @@ type FlagExporterInfo struct {
GeneratedHeaders android.Paths
}
var FlagExporterInfoProvider = blueprint.NewProvider(FlagExporterInfo{})
var FlagExporterInfoProvider = blueprint.NewProvider[FlagExporterInfo]()

View File

@@ -209,7 +209,7 @@ type SnapshotInfo struct {
HeaderLibs, Binaries, Objects, StaticLibs, SharedLibs, Rlibs, Dylibs map[string]string
}
var SnapshotInfoProvider = blueprint.NewMutatorProvider(SnapshotInfo{}, "deps")
var SnapshotInfoProvider = blueprint.NewMutatorProvider[SnapshotInfo]("deps")
var _ android.ImageInterface = (*snapshotModule)(nil)