diff options
Diffstat (limited to 'android')
-rw-r--r-- | android/all_teams.go | 12 | ||||
-rw-r--r-- | android/apex.go | 7 | ||||
-rw-r--r-- | android/module.go | 2 | ||||
-rw-r--r-- | android/package.go | 10 | ||||
-rw-r--r-- | android/singleton.go | 4 | ||||
-rw-r--r-- | android/team.go | 12 |
6 files changed, 40 insertions, 7 deletions
diff --git a/android/all_teams.go b/android/all_teams.go index 3b20107b9..8b55adebd 100644 --- a/android/all_teams.go +++ b/android/all_teams.go @@ -78,19 +78,19 @@ func (t *allTeamsSingleton) GenerateBuildActions(ctx SingletonContext) { t.teams = make(map[string]teamProperties) t.teams_for_mods = make(map[string]moduleTeamAndTestInfo) - ctx.VisitAllModules(func(module Module) { + ctx.VisitAllModuleProxies(func(module ModuleProxy) { bpFile := ctx.BlueprintFile(module) // Package Modules and Team Modules are stored in a map so we can look them up by name for // modules without a team. - if pack, ok := module.(*packageModule); ok { + if pack, ok := OtherModuleProvider(ctx, module, PackageInfoProvider); ok { // Packages don't have names, use the blueprint file as the key. we can't get qualifiedModuleId in t context. pkgKey := bpFile - t.packages[pkgKey] = pack.properties + t.packages[pkgKey] = pack.Properties return } - if team, ok := module.(*teamModule); ok { - t.teams[team.Name()] = team.properties + if team, ok := OtherModuleProvider(ctx, module, TeamInfoProvider); ok { + t.teams[module.Name()] = team.Properties return } @@ -116,7 +116,7 @@ func (t *allTeamsSingleton) GenerateBuildActions(ctx SingletonContext) { testOnly: testModInfo.TestOnly, topLevelTestTarget: testModInfo.TopLevelTarget, kind: ctx.ModuleType(module), - teamName: module.base().Team(), + teamName: OtherModuleProviderOrDefault(ctx, module, CommonModuleInfoKey).Team, } t.teams_for_mods[module.Name()] = entry diff --git a/android/apex.go b/android/apex.go index 91fa2c718..4e92f44f6 100644 --- a/android/apex.go +++ b/android/apex.go @@ -646,6 +646,13 @@ type ApexBundleDepsInfoIntf interface { FullListPath() Path } +type ApexBundleDepsData struct { + Updatable bool + FlatListPath Path +} + +var ApexBundleDepsDataProvider = blueprint.NewProvider[ApexBundleDepsData]() + func (d *ApexBundleDepsInfo) FlatListPath() Path { return d.flatListPath } diff --git a/android/module.go b/android/module.go index 984f0372a..d19648124 100644 --- a/android/module.go +++ b/android/module.go @@ -1940,6 +1940,7 @@ type CommonModuleInfo struct { VintfFragmentModuleNames []string Dists []Dist ExportedToMake bool + Team string } type ApiLevelOrPlatform struct { @@ -2300,6 +2301,7 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) VintfFragmentModuleNames: m.module.VintfFragmentModuleNames(ctx), Dists: m.Dists(), ExportedToMake: m.ExportedToMake(), + Team: m.Team(), } if mm, ok := m.module.(interface { MinSdkVersion(ctx EarlyModuleContext) ApiLevel diff --git a/android/package.go b/android/package.go index 385326e53..42f17b1d5 100644 --- a/android/package.go +++ b/android/package.go @@ -38,6 +38,12 @@ type packageProperties struct { Default_team *string `android:"path"` } +type PackageInfo struct { + Properties packageProperties +} + +var PackageInfoProvider = blueprint.NewProvider[PackageInfo]() + type packageModule struct { ModuleBase @@ -60,6 +66,10 @@ func (p *packageModule) GenerateBuildActions(ctx blueprint.ModuleContext) { Enabled: true, PrimaryLicensesProperty: p.primaryLicensesProperty, }) + + ctx.SetProvider(PackageInfoProvider, PackageInfo{ + Properties: p.properties, + }) } func (p *packageModule) qualifiedModuleId(ctx BaseModuleContext) qualifiedModuleName { diff --git a/android/singleton.go b/android/singleton.go index a03ea74aa..96b10223f 100644 --- a/android/singleton.go +++ b/android/singleton.go @@ -290,6 +290,10 @@ func (s *singletonContextAdaptor) ModuleType(module blueprint.Module) string { return s.SingletonContext.ModuleType(getWrappedModule(module)) } +func (s *singletonContextAdaptor) BlueprintFile(module blueprint.Module) string { + return s.SingletonContext.BlueprintFile(getWrappedModule(module)) +} + func (s *singletonContextAdaptor) VisitAllModulesBlueprint(visit func(blueprint.Module)) { s.SingletonContext.VisitAllModules(visit) } diff --git a/android/team.go b/android/team.go index c273dc647..ad37f28c9 100644 --- a/android/team.go +++ b/android/team.go @@ -32,6 +32,12 @@ type teamProperties struct { Trendy_team_id *string `json:"trendy_team_id"` } +type TeamInfo struct { + Properties teamProperties +} + +var TeamInfoProvider = blueprint.NewProvider[TeamInfo]() + type teamModule struct { ModuleBase DefaultableModuleBase @@ -48,7 +54,11 @@ var TestOnlyProviderKey = blueprint.NewProvider[TestModuleInformation]() // Real work is done for the module that depends on us. // If needed, the team can serialize the config to json/proto file as well. -func (t *teamModule) GenerateAndroidBuildActions(ctx ModuleContext) {} +func (t *teamModule) GenerateAndroidBuildActions(ctx ModuleContext) { + SetProvider(ctx, TeamInfoProvider, TeamInfo{ + Properties: t.properties, + }) +} func (t *teamModule) TrendyTeamId(ctx ModuleContext) string { return *t.properties.Trendy_team_id |