Use OutputFilesProvider on global_compat_config am: 9e7127ff3b

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3137576

Change-Id: Icc49328fa96fbc0b5673bfa05d15ab20513804fd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
mrziwang
2024-06-20 17:56:15 +00:00
committed by Automerger Merge Worker

View File

@@ -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.