diff options
Diffstat (limited to 'android/module.go')
-rw-r--r-- | android/module.go | 46 |
1 files changed, 41 insertions, 5 deletions
diff --git a/android/module.go b/android/module.go index d8f004c61..6fd8657ff 100644 --- a/android/module.go +++ b/android/module.go @@ -519,6 +519,9 @@ type commonProperties struct { // trace, but influence modules among products. SoongConfigTrace soongConfigTrace `blueprint:"mutated"` SoongConfigTraceHash string `blueprint:"mutated"` + + // The team (defined by the owner/vendor) who owns the property. + Team *string `android:"path"` } type distProperties struct { @@ -531,6 +534,12 @@ type distProperties struct { Dists []Dist `android:"arch_variant"` } +type TeamDepTagType struct { + blueprint.BaseDependencyTag +} + +var teamDepTag = TeamDepTagType{} + // CommonTestOptions represents the common `test_options` properties in // Android.bp. type CommonTestOptions struct { @@ -992,6 +1001,12 @@ func (m *ModuleBase) ComponentDepsMutator(BottomUpMutatorContext) {} func (m *ModuleBase) DepsMutator(BottomUpMutatorContext) {} +func (m *ModuleBase) baseDepsMutator(ctx BottomUpMutatorContext) { + if m.Team() != "" { + ctx.AddDependency(ctx.Module(), teamDepTag, m.Team()) + } +} + // AddProperties "registers" the provided props // each value in props MUST be a pointer to a struct func (m *ModuleBase) AddProperties(props ...interface{}) { @@ -1437,6 +1452,10 @@ func (m *ModuleBase) Owner() string { return String(m.commonProperties.Owner) } +func (m *ModuleBase) Team() string { + return String(m.commonProperties.Team) +} + func (m *ModuleBase) setImageVariation(variant string) { m.commonProperties.ImageVariation = variant } @@ -1622,14 +1641,31 @@ func (m *ModuleBase) earlyModuleContextFactory(ctx blueprint.EarlyModuleContext) func (m *ModuleBase) baseModuleContextFactory(ctx blueprint.BaseModuleContext) baseModuleContext { return baseModuleContext{ bp: ctx, + archModuleContext: m.archModuleContextFactory(ctx), earlyModuleContext: m.earlyModuleContextFactory(ctx), - os: m.commonProperties.CompileOS, - target: m.commonProperties.CompileTarget, - targetPrimary: m.commonProperties.CompilePrimary, - multiTargets: m.commonProperties.CompileMultiTargets, } } +func (m *ModuleBase) archModuleContextFactory(ctx blueprint.IncomingTransitionContext) archModuleContext { + config := ctx.Config().(Config) + target := m.Target() + primaryArch := false + if len(config.Targets[target.Os]) <= 1 { + primaryArch = true + } else { + primaryArch = target.Arch.ArchType == config.Targets[target.Os][0].Arch.ArchType + } + + return archModuleContext{ + os: m.commonProperties.CompileOS, + target: m.commonProperties.CompileTarget, + targetPrimary: m.commonProperties.CompilePrimary, + multiTargets: m.commonProperties.CompileMultiTargets, + primaryArch: primaryArch, + } + +} + func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) { ctx := &moduleContext{ module: m.module, @@ -1692,7 +1728,7 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) // ensure all direct android.Module deps are enabled ctx.VisitDirectDepsBlueprint(func(bm blueprint.Module) { if m, ok := bm.(Module); ok { - ctx.validateAndroidModule(bm, ctx.OtherModuleDependencyTag(m), ctx.baseModuleContext.strictVisitDeps) + ctx.validateAndroidModule(bm, ctx.OtherModuleDependencyTag(m), ctx.baseModuleContext.strictVisitDeps, false) } }) |