Lines Matching refs:ctx
54 func (p *providerTestModule) GenerateBuildActions(ctx ModuleContext) {
55 unset, ok := ModuleProvider(ctx, providerTestUnsetInfoProvider)
65 _, _ = ModuleProvider(ctx, providerTestUnusedMutatorProvider)
67 …SetProvider(ctx, providerTestGenerateBuildActionsInfoProvider, &providerTestGenerateBuildActionsIn…
68 Value: ctx.ModuleName(),
71 mp, ok := ModuleProvider(ctx, providerTestMutatorInfoProvider)
76 ctx.VisitDirectDeps(func(module Module) {
77 gbap, _ := OtherModuleProvider(ctx, module, providerTestGenerateBuildActionsInfoProvider)
84 func providerTestDepsMutator(ctx BottomUpMutatorContext) {
85 if p, ok := ctx.Module().(*providerTestModule); ok {
86 ctx.AddDependency(ctx.Module(), nil, p.properties.Deps...)
90 func providerTestMutator(ctx BottomUpMutatorContext) {
91 values := []string{strings.ToLower(ctx.ModuleName())}
93 ctx.VisitDirectDeps(func(module Module) {
94 mp, _ := OtherModuleProvider(ctx, module, providerTestMutatorInfoProvider)
100 SetProvider(ctx, providerTestMutatorInfoProvider, &providerTestMutatorInfo{
105 func providerTestAfterMutator(ctx BottomUpMutatorContext) {
107 _, _ = ModuleProvider(ctx, providerTestMutatorInfoProvider)
111 ctx := NewContext()
112 ctx.RegisterModuleType("provider_module", newProviderTestModule)
113 ctx.RegisterBottomUpMutator("provider_deps_mutator", providerTestDepsMutator)
114 ctx.RegisterBottomUpMutator("provider_mutator", providerTestMutator)
115 ctx.RegisterBottomUpMutator("provider_after_mutator", providerTestAfterMutator)
117 ctx.MockFileSystem(map[string][]byte{
140 _, errs := ctx.ParseBlueprintsFiles("Android.bp", nil)
142 _, errs = ctx.ResolveDependencies(nil)
145 _, errs = ctx.PrepareBuildActions(nil)
155 …aModule := ctx.moduleGroupFromName("A", nil).moduleByVariantName("").logicModule.(*providerTestMod…
163 …bModule := ctx.moduleGroupFromName("B", nil).moduleByVariantName("").logicModule.(*providerTestMod…
199 func invalidProviderUsageDepsMutator(ctx BottomUpMutatorContext) {
200 if i, ok := ctx.Module().(*invalidProviderUsageTestModule); ok {
201 ctx.AddDependency(ctx.Module(), nil, i.properties.Deps...)
205 func invalidProviderUsageParentMutator(ctx TopDownMutatorContext) {
206 if i, ok := ctx.Module().(*invalidProviderUsageTestModule); ok {
207 ctx.VisitDirectDeps(func(module Module) {
213 func invalidProviderUsageBeforeMutator(ctx BottomUpMutatorContext) {
214 if i, ok := ctx.Module().(*invalidProviderUsageTestModule); ok {
217 SetProvider(ctx, invalidProviderUsageMutatorInfoProvider, invalidProviderUsageMutatorInfo(""))
221 _, _ = ModuleProvider(ctx, invalidProviderUsageMutatorInfoProvider)
226 func invalidProviderUsageMutatorUnderTest(ctx TopDownMutatorContext) {
227 if i, ok := ctx.Module().(*invalidProviderUsageTestModule); ok {
230 …SetProvider(ctx, invalidProviderUsageGenerateBuildActionsInfoProvider, invalidProviderUsageGenerat…
234 _, _ = ModuleProvider(ctx, invalidProviderUsageGenerateBuildActionsInfoProvider)
240 ctx.VisitDirectDeps(func(module Module) {
241 _, _ = OtherModuleProvider(ctx, module, invalidProviderUsageMutatorInfoProvider)
247 func invalidProviderUsageAfterMutator(ctx BottomUpMutatorContext) {
248 if i, ok := ctx.Module().(*invalidProviderUsageTestModule); ok {
251 SetProvider(ctx, invalidProviderUsageMutatorInfoProvider, invalidProviderUsageMutatorInfo(""))
255 SetProvider(ctx, invalidProviderUsageMutatorInfoProvider, invalidProviderUsageMutatorInfo(""))
260 func (i *invalidProviderUsageTestModule) GenerateBuildActions(ctx ModuleContext) {
263 SetProvider(ctx, invalidProviderUsageMutatorInfoProvider, invalidProviderUsageMutatorInfo(""))
268 _, _ = OtherModuleProvider(ctx, i.parent, invalidProviderUsageGenerateBuildActionsInfoProvider)
271 …SetProvider(ctx, invalidProviderUsageGenerateBuildActionsInfoProvider, invalidProviderUsageGenerat…
272 …SetProvider(ctx, invalidProviderUsageGenerateBuildActionsInfoProvider, invalidProviderUsageGenerat…
279 ctx := NewContext()
280 ctx.RegisterModuleType("invalid_provider_usage_test_module", func() (Module, []interface{}) {
284 ctx.RegisterBottomUpMutator("deps", invalidProviderUsageDepsMutator)
285 ctx.RegisterBottomUpMutator("before", invalidProviderUsageBeforeMutator)
286 ctx.RegisterTopDownMutator("mutator_under_test", invalidProviderUsageMutatorUnderTest)
287 ctx.RegisterBottomUpMutator("after", invalidProviderUsageAfterMutator)
288 ctx.RegisterTopDownMutator("parent", invalidProviderUsageParentMutator)
291 ctx.SkipCloneModulesAfterMutators = true
329 ctx.MockFileSystem(map[string][]byte{
333 _, errs := ctx.ParseBlueprintsFiles("Android.bp", nil)
336 _, errs = ctx.ResolveDependencies(nil)
340 _, errs = ctx.PrepareBuildActions(nil)