Add source file provider for genrule/srcs, python libraries and rust libraries.
Change-Id: I2d7d4684a10c15aeecc27b8db800ab27a807d2e2
This commit is contained in:
parent
8094b6bf9d
commit
26df39fe44
13 changed files with 19 additions and 22 deletions
|
@ -93,7 +93,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",
|
||||
|
|
|
@ -290,6 +290,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{})
|
|
@ -206,6 +206,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
|
@ -2322,6 +2322,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()})
|
||||
|
||||
aconfig.CollectTransitiveAconfigFiles(ctx, &c.transitiveAconfigFiles)
|
||||
|
||||
|
|
|
@ -424,6 +424,7 @@ func (g *Module) generateCommonBuildActions(ctx android.ModuleContext) {
|
|||
return srcFiles
|
||||
}
|
||||
srcFiles := addLabelsForInputs("srcs", g.properties.Srcs, g.properties.Exclude_srcs)
|
||||
ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: srcFiles.Strings()})
|
||||
|
||||
var copyFrom android.Paths
|
||||
var outputFiles android.WritablePaths
|
||||
|
|
|
@ -24,6 +24,7 @@ import (
|
|||
|
||||
"github.com/google/blueprint/pathtools"
|
||||
"github.com/google/blueprint/proptools"
|
||||
"github.com/google/blueprint"
|
||||
|
||||
"android/soong/aconfig"
|
||||
"android/soong/android"
|
||||
|
@ -1170,6 +1171,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars, extraClasspath
|
|||
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
|
||||
|
|
|
@ -1477,7 +1477,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 {
|
||||
|
|
|
@ -430,6 +430,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)
|
||||
|
|
|
@ -951,6 +951,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() {
|
||||
|
|
|
@ -272,6 +272,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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue