ExportableModule no longer implements OutputFileProducer

multitree.ExportableModule no longer implements
android.OutputFileProducer

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

ApiSurface and apexBundle are included in this change.

Test: CI
Bug: 339477385
Change-Id: I9247bb2dfed270a879f8bc96c6aa06803fde0150
This commit is contained in:
mrziwang
2024-06-13 12:05:18 -07:00
committed by Zi Wang
parent 26faf1b321
commit e7ec89e0a9
3 changed files with 15 additions and 31 deletions

View File

@@ -1370,25 +1370,6 @@ func (a *apexBundle) DepIsInSameApex(_ android.BaseModuleContext, _ android.Modu
return true return true
} }
var _ android.OutputFileProducer = (*apexBundle)(nil)
// Implements android.OutputFileProducer
func (a *apexBundle) OutputFiles(tag string) (android.Paths, error) {
switch tag {
case "", android.DefaultDistTag:
// This is the default dist path.
return android.Paths{a.outputFile}, nil
case imageApexSuffix:
// uncompressed one
if a.outputApexFile != nil {
return android.Paths{a.outputApexFile}, nil
}
fallthrough
default:
return nil, fmt.Errorf("unsupported module reference tag %q", tag)
}
}
var _ multitree.Exportable = (*apexBundle)(nil) var _ multitree.Exportable = (*apexBundle)(nil)
func (a *apexBundle) Exportable() bool { func (a *apexBundle) Exportable() bool {
@@ -2432,6 +2413,8 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
a.providePrebuiltInfo(ctx) a.providePrebuiltInfo(ctx)
a.required = a.RequiredModuleNames(ctx) a.required = a.RequiredModuleNames(ctx)
a.setOutputFiles(ctx)
} }
// Set prebuiltInfoProvider. This will be used by `apex_prebuiltinfo_singleton` to print out a metadata file // Set prebuiltInfoProvider. This will be used by `apex_prebuiltinfo_singleton` to print out a metadata file
@@ -2460,6 +2443,18 @@ func (a *apexBundle) provideApexExportsInfo(ctx android.ModuleContext) {
}) })
} }
// Set output files to outputFiles property, which is later used to set the
// OutputFilesProvider
func (a *apexBundle) setOutputFiles(ctx android.ModuleContext) {
// default dist path
ctx.SetOutputFiles(android.Paths{a.outputFile}, "")
ctx.SetOutputFiles(android.Paths{a.outputFile}, android.DefaultDistTag)
// uncompressed one
if a.outputApexFile != nil {
ctx.SetOutputFiles(android.Paths{a.outputApexFile}, imageApexSuffix)
}
}
// apexBootclasspathFragmentFiles returns the list of apexFile structures defining the files that // apexBootclasspathFragmentFiles returns the list of apexFile structures defining the files that
// the bootclasspath_fragment contributes to the apex. // the bootclasspath_fragment contributes to the apex.
func apexBootclasspathFragmentFiles(ctx android.ModuleContext, module blueprint.Module) []apexFile { func apexBootclasspathFragmentFiles(ctx android.ModuleContext, module blueprint.Module) []apexFile {

View File

@@ -16,8 +16,6 @@ package multitree
import ( import (
"android/soong/android" "android/soong/android"
"fmt"
"github.com/google/blueprint" "github.com/google/blueprint"
) )
@@ -40,7 +38,6 @@ type ApiSurface struct {
ExportableModuleBase ExportableModuleBase
properties apiSurfaceProperties properties apiSurfaceProperties
allOutputs android.Paths
taggedOutputs map[string]android.Paths taggedOutputs map[string]android.Paths
} }
@@ -86,15 +83,9 @@ func (surface *ApiSurface) GenerateAndroidBuildActions(ctx android.ModuleContext
Inputs: allOutputs, Inputs: allOutputs,
}) })
surface.allOutputs = allOutputs
surface.taggedOutputs = contributionFiles surface.taggedOutputs = contributionFiles
}
func (surface *ApiSurface) OutputFiles(tag string) (android.Paths, error) { ctx.SetOutputFiles(allOutputs, "")
if tag != "" {
return nil, fmt.Errorf("unknown tag: %q", tag)
}
return surface.allOutputs, nil
} }
func (surface *ApiSurface) TaggedOutputs() map[string]android.Paths { func (surface *ApiSurface) TaggedOutputs() map[string]android.Paths {
@@ -105,7 +96,6 @@ func (surface *ApiSurface) Exportable() bool {
return true return true
} }
var _ android.OutputFileProducer = (*ApiSurface)(nil)
var _ Exportable = (*ApiSurface)(nil) var _ Exportable = (*ApiSurface)(nil)
type ApiContribution interface { type ApiContribution interface {

View File

@@ -50,7 +50,6 @@ type Exportable interface {
type ExportableModule interface { type ExportableModule interface {
android.Module android.Module
android.OutputFileProducer
Exportable Exportable
} }