Create src file provider in build/blueprint am: a992d06f60 am: 516ef4f48e

Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2854653

Change-Id: I30043fba7655e449da27811a4fdb008a2f31bb02
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Aditya Choudhary 2023-12-06 08:57:54 +00:00 committed by Automerger Merge Worker
commit a0377a7bc9
3 changed files with 10 additions and 0 deletions

View file

@ -52,6 +52,7 @@ bootstrap_go_package {
"provider.go",
"scope.go",
"singleton_ctx.go",
"source_file_provider.go"
],
testSrcs: [
"context_test.go",

View file

@ -337,6 +337,7 @@ func (g *GoPackage) GenerateBuildActions(ctx blueprint.ModuleContext) {
buildGoPackage(ctx, g.pkgRoot, g.properties.PkgPath, g.archiveFile,
srcs, genSrcs)
ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: srcs})
}
func (g *GoPackage) Srcs() []string {
@ -533,6 +534,7 @@ func (g *GoBinary) GenerateBuildActions(ctx blueprint.ModuleContext) {
Validations: validations,
Optional: !g.properties.Default,
})
ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: srcs})
}
func buildGoPluginLoader(ctx blueprint.ModuleContext, pkgPath, pluginSrc string) bool {

7
source_file_provider.go Normal file
View file

@ -0,0 +1,7 @@
package blueprint
type SrcsFileProviderData struct {
SrcPaths []string
}
var SrcsFileProviderKey = NewProvider(SrcsFileProviderData{})