Allow calling ctx.DistForGoal from GenerateAndroidBuildActions
Right now you have to dist files in either the AndroidMk stuff,
or in MakeVars providers. Allow calling it from
GenerateAndroidBuildActions so that we can further remove our reliance
on make.
Bug: 395184523
Test: m nothing --no-skip-soong-tests
Change-Id: I6ad12fa89896b86c333fc2d23eaf4f77466e42a3
diff --git a/android/module.go b/android/module.go
index 39a1654..80275a3 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1925,6 +1925,12 @@
var HostToolProviderInfoProvider = blueprint.NewProvider[HostToolProviderInfo]()
+type DistInfo struct {
+ Dists []dist
+}
+
+var DistProvider = blueprint.NewProvider[DistInfo]()
+
type SourceFileGenerator interface {
GeneratedSourceFiles() Paths
GeneratedHeaderDirs() Paths
@@ -2222,6 +2228,13 @@
Phonies: ctx.phonies,
})
}
+
+ if len(ctx.dists) > 0 {
+ SetProvider(ctx, DistProvider, DistInfo{
+ Dists: ctx.dists,
+ })
+ }
+
buildComplianceMetadataProvider(ctx, m)
commonData := CommonModuleInfo{