Add source file provider for genrule/srcs, python libraries and rust libraries.
Ignore-AOSP-First: CPing test_spec rule to udc-mainline-prod to support migration of test targets. Cherry pick of:aosp/2786121 Change-Id: I2d7d4684a10c15aeecc27b8db800ab27a807d2e2 Merged-In: I2d7d4684a10c15aeecc27b8db800ab27a807d2e2
This commit is contained in:
@@ -88,7 +88,6 @@ bootstrap_go_package {
|
||||
"singleton.go",
|
||||
"singleton_module.go",
|
||||
"soong_config_modules.go",
|
||||
"source_file_provider.go",
|
||||
"test_asserts.go",
|
||||
"test_suites.go",
|
||||
"testing.go",
|
||||
|
@@ -237,6 +237,7 @@ func (fg *fileGroup) GenerateAndroidBuildActions(ctx ModuleContext) {
|
||||
if fg.properties.Path != nil {
|
||||
fg.srcs = PathsWithModuleSrcSubDir(ctx, fg.srcs, String(fg.properties.Path))
|
||||
}
|
||||
ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: fg.srcs.Strings()})
|
||||
}
|
||||
|
||||
func (fg *fileGroup) Srcs() Paths {
|
||||
|
@@ -1,11 +0,0 @@
|
||||
package android
|
||||
|
||||
import (
|
||||
"github.com/google/blueprint"
|
||||
)
|
||||
|
||||
type SrcsFileProviderData struct {
|
||||
SrcPaths Paths
|
||||
}
|
||||
|
||||
var SrcsFileProviderKey = blueprint.NewProvider(SrcsFileProviderData{})
|
@@ -208,6 +208,7 @@ func (bpf *bpf) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
}
|
||||
|
||||
}
|
||||
ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: srcs.Strings()})
|
||||
}
|
||||
|
||||
func (bpf *bpf) AndroidMk() android.AndroidMkData {
|
||||
|
1
cc/cc.go
1
cc/cc.go
@@ -2109,6 +2109,7 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
|
||||
if c.testModule {
|
||||
ctx.SetProvider(testing.TestModuleProviderKey, testing.TestModuleProviderData{})
|
||||
}
|
||||
ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: deps.GeneratedSources.Strings()})
|
||||
|
||||
c.maybeInstall(ctx, apexInfo)
|
||||
}
|
||||
|
@@ -419,6 +419,7 @@ func (g *Module) generateCommonBuildActions(ctx android.ModuleContext) {
|
||||
addLocationLabel(in, inputLocation{paths})
|
||||
}
|
||||
}
|
||||
ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: srcFiles.Strings()})
|
||||
|
||||
var copyFrom android.Paths
|
||||
var outputFiles android.WritablePaths
|
||||
|
@@ -22,6 +22,7 @@ import (
|
||||
|
||||
"github.com/google/blueprint/pathtools"
|
||||
"github.com/google/blueprint/proptools"
|
||||
"github.com/google/blueprint"
|
||||
|
||||
"android/soong/android"
|
||||
"android/soong/dexpreopt"
|
||||
@@ -1105,6 +1106,7 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
|
||||
uniqueSrcFiles = append(uniqueSrcFiles, uniqueJavaFiles...)
|
||||
uniqueSrcFiles = append(uniqueSrcFiles, uniqueKtFiles...)
|
||||
j.uniqueSrcFiles = uniqueSrcFiles
|
||||
ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: uniqueSrcFiles.Strings()})
|
||||
|
||||
// We don't currently run annotation processors in turbine, which means we can't use turbine
|
||||
// generated header jars when an annotation processor that generates API is enabled. One
|
||||
|
@@ -1404,7 +1404,6 @@ func (module *SdkLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext)
|
||||
}
|
||||
}
|
||||
ctx.SetProvider(android.AdditionalSdkInfoProvider, android.AdditionalSdkInfo{additionalSdkInfo})
|
||||
ctx.SetProvider(android.SrcsFileProviderKey, android.SrcsFileProviderData{SrcPaths: module.uniqueSrcFiles})
|
||||
}
|
||||
|
||||
func (module *SdkLibrary) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
|
@@ -404,6 +404,7 @@ func (p *PythonLibraryModule) AddDepsOnPythonLauncherAndStdlib(ctx android.Botto
|
||||
// GenerateAndroidBuildActions performs build actions common to all Python modules
|
||||
func (p *PythonLibraryModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
expandedSrcs := android.PathsForModuleSrcExcludes(ctx, p.properties.Srcs, p.properties.Exclude_srcs)
|
||||
ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: expandedSrcs.Strings()})
|
||||
|
||||
// expand data files from "data" property.
|
||||
expandedData := android.PathsForModuleSrc(ctx, p.properties.Data)
|
||||
|
@@ -958,6 +958,7 @@ func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
|
||||
sourceLib := sourceMod.(*Module).compiler.(*libraryDecorator)
|
||||
mod.sourceProvider.setOutputFiles(sourceLib.sourceProvider.Srcs())
|
||||
}
|
||||
ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: mod.sourceProvider.Srcs().Strings()})
|
||||
}
|
||||
|
||||
if mod.compiler != nil && !mod.compiler.Disabled() {
|
||||
|
@@ -261,6 +261,7 @@ func (s *ShBinary) generateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
Output: s.outputFilePath,
|
||||
Input: s.sourceFilePath,
|
||||
})
|
||||
ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: []string{s.sourceFilePath.String()}})
|
||||
}
|
||||
|
||||
func (s *ShBinary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
|
@@ -241,12 +241,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
|
||||
@@ -264,7 +265,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
|
||||
|
@@ -95,11 +95,11 @@ func (module *CodeMetadataModule) GenerateAndroidBuildActions(ctx android.Module
|
||||
|
||||
for _, m := range ctx.GetDirectDepsWithTag(codeDepTag) {
|
||||
targetName := m.Name()
|
||||
var moduleSrcs android.Paths
|
||||
if ctx.OtherModuleHasProvider(m, android.SrcsFileProviderKey) {
|
||||
var moduleSrcs []string
|
||||
if ctx.OtherModuleHasProvider(m, blueprint.SrcsFileProviderKey) {
|
||||
moduleSrcs = ctx.OtherModuleProvider(
|
||||
m, android.SrcsFileProviderKey,
|
||||
).(android.SrcsFileProviderData).SrcPaths
|
||||
m, blueprint.SrcsFileProviderKey,
|
||||
).(blueprint.SrcsFileProviderData).SrcPaths
|
||||
}
|
||||
if module.properties.MultiOwnership {
|
||||
metadata := &code_metadata_internal_proto.CodeMetadataInternal_TargetOwnership{
|
||||
@@ -107,7 +107,7 @@ func (module *CodeMetadataModule) GenerateAndroidBuildActions(ctx android.Module
|
||||
TrendyTeamId: &module.properties.TeamId,
|
||||
Path: &bpFilePath,
|
||||
MultiOwnership: &module.properties.MultiOwnership,
|
||||
SourceFiles: moduleSrcs.Strings(),
|
||||
SourceFiles: moduleSrcs,
|
||||
}
|
||||
metadataList = append(metadataList, metadata)
|
||||
} else {
|
||||
@@ -115,7 +115,7 @@ func (module *CodeMetadataModule) GenerateAndroidBuildActions(ctx android.Module
|
||||
TargetName: &targetName,
|
||||
TrendyTeamId: &module.properties.TeamId,
|
||||
Path: &bpFilePath,
|
||||
SourceFiles: moduleSrcs.Strings(),
|
||||
SourceFiles: moduleSrcs,
|
||||
}
|
||||
metadataList = append(metadataList, metadata)
|
||||
}
|
||||
|
Reference in New Issue
Block a user