From 9e7127ff3bedc2d7411e4432180226439d953ea9 Mon Sep 17 00:00:00 2001 From: mrziwang Date: Tue, 18 Jun 2024 16:10:47 -0700 Subject: [PATCH] Use OutputFilesProvider on global_compat_config 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: I6deb4a005876848f28a5b823a712d9eea33a44e6 --- java/platform_compat_config.go | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/java/platform_compat_config.go b/java/platform_compat_config.go index 45b994498..7cc6231ad 100644 --- a/java/platform_compat_config.go +++ b/java/platform_compat_config.go @@ -15,7 +15,6 @@ package java import ( - "fmt" "path/filepath" "android/soong/android" @@ -290,32 +289,23 @@ type globalCompatConfig struct { android.ModuleBase properties globalCompatConfigProperties - - outputFilePath android.OutputPath } func (c *globalCompatConfig) GenerateAndroidBuildActions(ctx android.ModuleContext) { filename := String(c.properties.Filename) inputPath := platformCompatConfigPath(ctx) - c.outputFilePath = android.PathForModuleOut(ctx, filename).OutputPath + outputFilePath := android.PathForModuleOut(ctx, filename).OutputPath // This ensures that outputFilePath has the correct name for others to // use, as the source file may have a different name. ctx.Build(pctx, android.BuildParams{ Rule: android.Cp, - Output: c.outputFilePath, + Output: outputFilePath, Input: inputPath, }) -} -func (h *globalCompatConfig) OutputFiles(tag string) (android.Paths, error) { - switch tag { - case "": - return android.Paths{h.outputFilePath}, nil - default: - return nil, fmt.Errorf("unsupported module reference tag %q", tag) - } + ctx.SetOutputFiles(android.Paths{outputFilePath}, "") } // global_compat_config provides access to the merged compat config xml file generated by the build.