aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Choudhary <caditya@google.com>2023-12-06 09:29:53 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-12-06 09:29:53 +0000
commit41510606d929b577a67dab6619204db7da73853b (patch)
treea938d5d212b0e290453c65e04b6a0e5ddcd2f3a5
parent9570d1bbedf6b79324cabf57a69a1c4dea66d6a5 (diff)
parenta0377a7bc9b2d3ce9e7040271d5af978ee6afaf1 (diff)
downloadblueprint-41510606d929b577a67dab6619204db7da73853b.tar.gz
Create src file provider in build/blueprint am: a992d06f60 am: 516ef4f48e am: a0377a7bc9
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2854653 Change-Id: Ifade029b6389d97b1acce4845352df20c08da51a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--Android.bp1
-rw-r--r--bootstrap/bootstrap.go2
-rw-r--r--source_file_provider.go7
3 files changed, 10 insertions, 0 deletions
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{})