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

@@ -20,6 +20,7 @@ import (
"android/soong/android"
"android/soong/testing/code_metadata_internal_proto"
"github.com/google/blueprint"
"google.golang.org/protobuf/proto"
)
@@ -83,7 +84,7 @@ type CodeMetadataProviderData struct {
IntermediatePath android.WritablePath
}
var CodeMetadataProviderKey = blueprint.NewProvider(CodeMetadataProviderData{})
var CodeMetadataProviderKey = blueprint.NewProvider[CodeMetadataProviderData]()
func (module *CodeMetadataModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
metadataList := make(

View File

@@ -20,8 +20,9 @@ import (
"android/soong/android"
"android/soong/testing/test_spec_proto"
"github.com/google/blueprint"
"google.golang.org/protobuf/proto"
"github.com/google/blueprint"
)
// ErrTestModuleDataNotFound is the error message for missing test module provider data.
@@ -81,12 +82,12 @@ type TestSpecProviderData struct {
IntermediatePath android.WritablePath
}
var TestSpecProviderKey = blueprint.NewProvider(TestSpecProviderData{})
var TestSpecProviderKey = blueprint.NewProvider[TestSpecProviderData]()
type TestModuleProviderData struct {
}
var TestModuleProviderKey = blueprint.NewProvider(TestModuleProviderData{})
var TestModuleProviderKey = blueprint.NewProvider[TestModuleProviderData]()
func (module *TestSpecModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
for _, m := range ctx.GetDirectDepsWithTag(testsDepTag) {