Lines Matching refs:ctx
54 func (p *providerTestModule) GenerateBuildActions(ctx ModuleContext) {
55 unset := ctx.Provider(providerTestUnsetInfoProvider).(providerTestUnsetInfo)
61 _ = ctx.Provider(providerTestUnusedMutatorProvider)
63 …ctx.SetProvider(providerTestGenerateBuildActionsInfoProvider, &providerTestGenerateBuildActionsInf…
64 Value: ctx.ModuleName(),
67 mp := ctx.Provider(providerTestMutatorInfoProvider).(*providerTestMutatorInfo)
72 ctx.VisitDirectDeps(func(module Module) {
73 …gbap := ctx.OtherModuleProvider(module, providerTestGenerateBuildActionsInfoProvider).(*providerTe…
80 func providerTestDepsMutator(ctx BottomUpMutatorContext) {
81 if p, ok := ctx.Module().(*providerTestModule); ok {
82 ctx.AddDependency(ctx.Module(), nil, p.properties.Deps...)
86 func providerTestMutator(ctx BottomUpMutatorContext) {
87 values := []string{strings.ToLower(ctx.ModuleName())}
89 ctx.VisitDirectDeps(func(module Module) {
90 mp := ctx.OtherModuleProvider(module, providerTestMutatorInfoProvider).(*providerTestMutatorInfo)
96 ctx.SetProvider(providerTestMutatorInfoProvider, &providerTestMutatorInfo{
101 func providerTestAfterMutator(ctx BottomUpMutatorContext) {
102 _ = ctx.Provider(providerTestMutatorInfoProvider)
106 ctx := NewContext()
107 ctx.RegisterModuleType("provider_module", newProviderTestModule)
108 ctx.RegisterBottomUpMutator("provider_deps_mutator", providerTestDepsMutator)
109 ctx.RegisterBottomUpMutator("provider_mutator", providerTestMutator)
110 ctx.RegisterBottomUpMutator("provider_after_mutator", providerTestAfterMutator)
112 ctx.MockFileSystem(map[string][]byte{
135 _, errs := ctx.ParseBlueprintsFiles("Blueprints", nil)
137 _, errs = ctx.ResolveDependencies(nil)
140 _, errs = ctx.PrepareBuildActions(nil)
150 …aModule := ctx.moduleGroupFromName("A", nil).moduleByVariantName("").logicModule.(*providerTestMod…
158 …bModule := ctx.moduleGroupFromName("B", nil).moduleByVariantName("").logicModule.(*providerTestMod…
194 func invalidProviderUsageDepsMutator(ctx BottomUpMutatorContext) {
195 if i, ok := ctx.Module().(*invalidProviderUsageTestModule); ok {
196 ctx.AddDependency(ctx.Module(), nil, i.properties.Deps...)
200 func invalidProviderUsageParentMutator(ctx TopDownMutatorContext) {
201 if i, ok := ctx.Module().(*invalidProviderUsageTestModule); ok {
202 ctx.VisitDirectDeps(func(module Module) {
208 func invalidProviderUsageBeforeMutator(ctx BottomUpMutatorContext) {
209 if i, ok := ctx.Module().(*invalidProviderUsageTestModule); ok {
212 ctx.SetProvider(invalidProviderUsageMutatorInfoProvider, invalidProviderUsageMutatorInfo(""))
216 _ = ctx.Provider(invalidProviderUsageMutatorInfoProvider)
221 func invalidProviderUsageMutatorUnderTest(ctx TopDownMutatorContext) {
222 if i, ok := ctx.Module().(*invalidProviderUsageTestModule); ok {
225 …ctx.SetProvider(invalidProviderUsageGenerateBuildActionsInfoProvider, invalidProviderUsageGenerate…
229 _ = ctx.Provider(invalidProviderUsageGenerateBuildActionsInfoProvider)
235 ctx.VisitDirectDeps(func(module Module) {
236 _ = ctx.OtherModuleProvider(module, invalidProviderUsageMutatorInfoProvider)
242 func invalidProviderUsageAfterMutator(ctx BottomUpMutatorContext) {
243 if i, ok := ctx.Module().(*invalidProviderUsageTestModule); ok {
246 ctx.SetProvider(invalidProviderUsageMutatorInfoProvider, invalidProviderUsageMutatorInfo(""))
250 ctx.SetProvider(invalidProviderUsageMutatorInfoProvider, invalidProviderUsageMutatorInfo(""))
255 func (i *invalidProviderUsageTestModule) GenerateBuildActions(ctx ModuleContext) {
258 ctx.SetProvider(invalidProviderUsageMutatorInfoProvider, invalidProviderUsageMutatorInfo(""))
263 _ = ctx.OtherModuleProvider(i.parent, invalidProviderUsageGenerateBuildActionsInfoProvider)
266 …ctx.SetProvider(invalidProviderUsageGenerateBuildActionsInfoProvider, invalidProviderUsageGenerate…
267 …ctx.SetProvider(invalidProviderUsageGenerateBuildActionsInfoProvider, invalidProviderUsageGenerate…
274 ctx := NewContext()
275 ctx.RegisterModuleType("invalid_provider_usage_test_module", func() (Module, []interface{}) {
279 ctx.RegisterBottomUpMutator("deps", invalidProviderUsageDepsMutator)
280 ctx.RegisterBottomUpMutator("before", invalidProviderUsageBeforeMutator)
281 ctx.RegisterTopDownMutator("mutator_under_test", invalidProviderUsageMutatorUnderTest)
282 ctx.RegisterBottomUpMutator("after", invalidProviderUsageAfterMutator)
283 ctx.RegisterTopDownMutator("parent", invalidProviderUsageParentMutator)
286 ctx.skipCloneModulesAfterMutators = true
324 ctx.MockFileSystem(map[string][]byte{
328 _, errs := ctx.ParseBlueprintsFiles("Blueprints", nil)
331 _, errs = ctx.ResolveDependencies(nil)
335 _, errs = ctx.PrepareBuildActions(nil)