From a992d06f60cbe024cbba150ee6fa398719a4f5a8 Mon Sep 17 00:00:00 2001 From: Aditya Choudhary Date: Fri, 1 Dec 2023 13:17:45 +0000 Subject: Create src file provider in build/blueprint Change-Id: I7091effe7791c1f3ea57e775b37cd72f4ee13d03 --- Android.bp | 1 + bootstrap/bootstrap.go | 2 ++ source_file_provider.go | 7 +++++++ 3 files changed, 10 insertions(+) create mode 100644 source_file_provider.go diff --git a/Android.bp b/Android.bp index 20fa495..246207a 100644 --- a/Android.bp +++ b/Android.bp @@ -52,6 +52,7 @@ bootstrap_go_package { "provider.go", "scope.go", "singleton_ctx.go", + "source_file_provider.go" ], testSrcs: [ "context_test.go", diff --git a/bootstrap/bootstrap.go b/bootstrap/bootstrap.go index 0326c4a..97ed2bd 100644 --- a/bootstrap/bootstrap.go +++ b/bootstrap/bootstrap.go @@ -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 { diff --git a/source_file_provider.go b/source_file_provider.go new file mode 100644 index 0000000..6ee4d09 --- /dev/null +++ b/source_file_provider.go @@ -0,0 +1,7 @@ +package blueprint + +type SrcsFileProviderData struct { + SrcPaths []string +} + +var SrcsFileProviderKey = NewProvider(SrcsFileProviderData{}) -- cgit v1.2.3