From aa2a2b61196db36ded1c880d607de6c359883f2d Mon Sep 17 00:00:00 2001 From: mrziwang Date: Mon, 1 Jul 2024 12:09:20 -0700 Subject: [PATCH] Use OutputFilesProvider on prebuilt_stubs_sources 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: I3468505c678f7af92d669d1a02d6f26b1c2e199d --- java/droidstubs.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/java/droidstubs.go b/java/droidstubs.go index b32b754d3..01571858c 100644 --- a/java/droidstubs.go +++ b/java/droidstubs.go @@ -1453,17 +1453,6 @@ type PrebuiltStubsSources struct { stubsSrcJar android.Path } -func (p *PrebuiltStubsSources) OutputFiles(tag string) (android.Paths, error) { - switch tag { - // prebuilt droidstubs does not output "exportable" stubs. - // Output the "everything" stubs srcjar file if the tag is ".exportable". - case "", ".exportable": - return android.Paths{p.stubsSrcJar}, nil - default: - return nil, fmt.Errorf("unsupported module reference tag %q", tag) - } -} - func (d *PrebuiltStubsSources) StubsSrcJar(_ StubsType) (android.Path, error) { return d.stubsSrcJar, nil } @@ -1502,6 +1491,11 @@ func (p *PrebuiltStubsSources) GenerateAndroidBuildActions(ctx android.ModuleCon rule.Build("zip src", "Create srcjar from prebuilt source") p.stubsSrcJar = outPath } + + ctx.SetOutputFiles(android.Paths{p.stubsSrcJar}, "") + // prebuilt droidstubs does not output "exportable" stubs. + // Output the "everything" stubs srcjar file if the tag is ".exportable". + ctx.SetOutputFiles(android.Paths{p.stubsSrcJar}, ".exportable") } func (p *PrebuiltStubsSources) Prebuilt() *android.Prebuilt {