Add source file provider for genrule/srcs, python libraries and rust libraries.

Change-Id: I2d7d4684a10c15aeecc27b8db800ab27a807d2e2
This commit is contained in:
Aditya Choudhary
2023-11-29 16:42:42 +00:00
parent 8094b6bf9d
commit 26df39fe44
13 changed files with 19 additions and 22 deletions

View File

@@ -254,12 +254,13 @@ func (m *syspropLibrary) CurrentSyspropApiFile() android.OptionalPath {
// generated java_library will depend on these API files.
func (m *syspropLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
baseModuleName := m.BaseModuleName()
for _, syspropFile := range android.PathsForModuleSrc(ctx, m.properties.Srcs) {
srcs := android.PathsForModuleSrc(ctx, m.properties.Srcs)
for _, syspropFile := range srcs {
if syspropFile.Ext() != ".sysprop" {
ctx.PropertyErrorf("srcs", "srcs contains non-sysprop file %q", syspropFile.String())
}
}
ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: srcs.Strings()})
if ctx.Failed() {
return
@@ -277,7 +278,7 @@ func (m *syspropLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext)
rule.Command().
BuiltTool("sysprop_api_dump").
Output(m.dumpedApiFile).
Inputs(android.PathsForModuleSrc(ctx, m.properties.Srcs))
Inputs(srcs)
rule.Build(baseModuleName+"_api_dump", baseModuleName+" api dump")
// check API rule