Use OutputFilesProvider on syspropJavaGenRule

In the context of incremental soong, the output files
inter-module-communication will be through OutputFilesProvider.
The OutputFileProducer interface will be deprecated.

Test: CI
Bug: 339477385
Change-Id: I3b1cb3a4cfafa1385ef27a427009abb13accf834
This commit is contained in:
mrziwang 2024-06-11 14:39:15 -07:00
parent afc28427cf
commit ba2a460008

View file

@ -49,8 +49,6 @@ type syspropJavaGenRule struct {
android.ModuleBase android.ModuleBase
properties syspropGenProperties properties syspropGenProperties
genSrcjars android.Paths
} }
type syspropRustGenRule struct { type syspropRustGenRule struct {
@ -59,7 +57,6 @@ type syspropRustGenRule struct {
properties rustLibraryProperties properties rustLibraryProperties
} }
var _ android.OutputFileProducer = (*syspropJavaGenRule)(nil)
var _ rust.SourceProvider = (*syspropRustGenRule)(nil) var _ rust.SourceProvider = (*syspropRustGenRule)(nil)
var ( var (
@ -100,6 +97,7 @@ func (g *syspropJavaGenRule) GenerateAndroidBuildActions(ctx android.ModuleConte
} }
}) })
var genSrcjars android.Paths
for _, syspropFile := range android.PathsForModuleSrc(ctx, g.properties.Srcs) { for _, syspropFile := range android.PathsForModuleSrc(ctx, g.properties.Srcs) {
srcJarFile := android.GenPathWithExt(ctx, "sysprop", syspropFile, "srcjar") srcJarFile := android.GenPathWithExt(ctx, "sysprop", syspropFile, "srcjar")
@ -114,8 +112,10 @@ func (g *syspropJavaGenRule) GenerateAndroidBuildActions(ctx android.ModuleConte
}, },
}) })
g.genSrcjars = append(g.genSrcjars, srcJarFile) genSrcjars = append(genSrcjars, srcJarFile)
} }
ctx.SetOutputFiles(genSrcjars, "")
} }
func (g *syspropJavaGenRule) DepsMutator(ctx android.BottomUpMutatorContext) { func (g *syspropJavaGenRule) DepsMutator(ctx android.BottomUpMutatorContext) {
@ -124,15 +124,6 @@ func (g *syspropJavaGenRule) DepsMutator(ctx android.BottomUpMutatorContext) {
ctx.AddFarVariationDependencies(nil, nil, proptools.String(g.properties.Check_api)) ctx.AddFarVariationDependencies(nil, nil, proptools.String(g.properties.Check_api))
} }
func (g *syspropJavaGenRule) OutputFiles(tag string) (android.Paths, error) {
switch tag {
case "":
return g.genSrcjars, nil
default:
return nil, fmt.Errorf("unsupported module reference tag %q", tag)
}
}
func syspropJavaGenFactory() android.Module { func syspropJavaGenFactory() android.Module {
g := &syspropJavaGenRule{} g := &syspropJavaGenRule{}
g.AddProperties(&g.properties) g.AddProperties(&g.properties)