blob: 77d5f433e446ea667df272b271c23e6e8d73fb52 [file] [log] [blame]
Colin Cross6362e272015-10-29 15:25:03 -07001// Copyright 2015 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Colin Cross635c3b02016-05-18 15:37:25 -070015package android
Colin Cross6362e272015-10-29 15:25:03 -070016
Colin Cross795c3772017-03-16 16:50:10 -070017import (
Colin Cross18c46802019-09-24 22:19:02 -070018 "reflect"
19
Colin Cross795c3772017-03-16 16:50:10 -070020 "github.com/google/blueprint"
Colin Cross519917d2017-11-02 16:35:56 -070021 "github.com/google/blueprint/proptools"
Colin Cross795c3772017-03-16 16:50:10 -070022)
Colin Cross6362e272015-10-29 15:25:03 -070023
Jeff Gastonaf3cc2d2017-09-27 17:01:44 -070024// Phases:
25// run Pre-arch mutators
26// run archMutator
27// run Pre-deps mutators
28// run depsMutator
29// run PostDeps mutators
Martin Stjernholm710ec3a2020-01-16 15:12:04 +000030// run FinalDeps mutators (CreateVariations disallowed in this phase)
Jeff Gastonaf3cc2d2017-09-27 17:01:44 -070031// continue on to GenerateAndroidBuildActions
Colin Cross1e676be2016-10-12 14:38:15 -070032
Colin Cross795c3772017-03-16 16:50:10 -070033func registerMutatorsToContext(ctx *blueprint.Context, mutators []*mutator) {
34 for _, t := range mutators {
35 var handle blueprint.MutatorHandle
36 if t.bottomUpMutator != nil {
37 handle = ctx.RegisterBottomUpMutator(t.name, t.bottomUpMutator)
38 } else if t.topDownMutator != nil {
39 handle = ctx.RegisterTopDownMutator(t.name, t.topDownMutator)
40 }
41 if t.parallel {
42 handle.Parallel()
Colin Cross1e676be2016-10-12 14:38:15 -070043 }
44 }
Colin Cross1e676be2016-10-12 14:38:15 -070045}
46
Martin Stjernholm710ec3a2020-01-16 15:12:04 +000047func registerMutators(ctx *blueprint.Context, preArch, preDeps, postDeps, finalDeps []RegisterMutatorFunc) {
Colin Crosscec81712017-07-13 14:43:27 -070048 mctx := &registerMutatorsContext{}
Nan Zhangdb0b9a32017-02-27 10:12:13 -080049
50 register := func(funcs []RegisterMutatorFunc) {
51 for _, f := range funcs {
Colin Crosscec81712017-07-13 14:43:27 -070052 f(mctx)
Nan Zhangdb0b9a32017-02-27 10:12:13 -080053 }
54 }
55
Colin Crosscec81712017-07-13 14:43:27 -070056 register(preArch)
Nan Zhangdb0b9a32017-02-27 10:12:13 -080057
Colin Crosscec81712017-07-13 14:43:27 -070058 register(preDeps)
59
60 mctx.BottomUp("deps", depsMutator).Parallel()
61
62 register(postDeps)
63
Martin Stjernholm710ec3a2020-01-16 15:12:04 +000064 mctx.finalPhase = true
65 register(finalDeps)
66
Colin Crosscec81712017-07-13 14:43:27 -070067 registerMutatorsToContext(ctx, mctx.mutators)
Colin Cross795c3772017-03-16 16:50:10 -070068}
69
70type registerMutatorsContext struct {
Martin Stjernholm710ec3a2020-01-16 15:12:04 +000071 mutators []*mutator
72 finalPhase bool
Colin Cross795c3772017-03-16 16:50:10 -070073}
Colin Cross1e676be2016-10-12 14:38:15 -070074
75type RegisterMutatorsContext interface {
Colin Cross25de6c32019-06-06 14:29:25 -070076 TopDown(name string, m TopDownMutator) MutatorHandle
77 BottomUp(name string, m BottomUpMutator) MutatorHandle
Colin Cross1e676be2016-10-12 14:38:15 -070078}
79
80type RegisterMutatorFunc func(RegisterMutatorsContext)
81
Colin Crosscec81712017-07-13 14:43:27 -070082var preArch = []RegisterMutatorFunc{
Dan Willemsen6e72ef72018-01-26 18:27:02 -080083 RegisterNamespaceMutator,
Paul Duffinaa4162e2020-05-05 11:35:43 +010084
Paul Duffinaa4162e2020-05-05 11:35:43 +010085 // Check the visibility rules are valid.
86 //
87 // This must run after the package renamer mutators so that any issues found during
88 // validation of the package's default_visibility property are reported using the
89 // correct package name and not the synthetic name.
90 //
91 // This must also be run before defaults mutators as the rules for validation are
92 // different before checking the rules than they are afterwards. e.g.
93 // visibility: ["//visibility:private", "//visibility:public"]
94 // would be invalid if specified in a module definition but is valid if it results
95 // from something like this:
96 //
97 // defaults {
98 // name: "defaults",
99 // // Be inaccessible outside a package by default.
100 // visibility: ["//visibility:private"]
101 // }
102 //
103 // defaultable_module {
104 // name: "defaultable_module",
105 // defaults: ["defaults"],
106 // // Override the default.
107 // visibility: ["//visibility:public"]
108 // }
109 //
Paul Duffin593b3c92019-12-05 14:31:48 +0000110 RegisterVisibilityRuleChecker,
Paul Duffinaa4162e2020-05-05 11:35:43 +0100111
112 // Apply properties from defaults modules to the referencing modules.
Paul Duffinafa9fa12020-04-29 16:47:28 +0100113 //
114 // Any mutators that are added before this will not see any modules created by
115 // a DefaultableHook.
Colin Cross89536d42017-07-07 14:35:50 -0700116 RegisterDefaultsPreArchMutators,
Paul Duffinaa4162e2020-05-05 11:35:43 +0100117
Paul Duffinc988c8e2020-04-29 18:27:14 +0100118 // Create an association between prebuilt modules and their corresponding source
119 // modules (if any).
Paul Duffinafa9fa12020-04-29 16:47:28 +0100120 //
121 // Must be run after defaults mutators to ensure that any modules created by
122 // a DefaultableHook can be either a prebuilt or a source module with a matching
123 // prebuilt.
Paul Duffinc988c8e2020-04-29 18:27:14 +0100124 RegisterPrebuiltsPreArchMutators,
125
Paul Duffinaa4162e2020-05-05 11:35:43 +0100126 // Gather the visibility rules for all modules for us during visibility enforcement.
127 //
128 // This must come after the defaults mutators to ensure that any visibility supplied
129 // in a defaults module has been successfully applied before the rules are gathered.
Paul Duffin593b3c92019-12-05 14:31:48 +0000130 RegisterVisibilityRuleGatherer,
Colin Crosscec81712017-07-13 14:43:27 -0700131}
132
Colin Crossae4c6182017-09-15 17:33:55 -0700133func registerArchMutator(ctx RegisterMutatorsContext) {
Colin Crossa195f912019-10-16 11:07:20 -0700134 ctx.BottomUp("os", osMutator).Parallel()
Colin Crossfb0c16e2019-11-20 17:12:35 -0800135 ctx.BottomUp("image", imageMutator).Parallel()
Colin Crossae4c6182017-09-15 17:33:55 -0700136 ctx.BottomUp("arch", archMutator).Parallel()
Colin Crossae4c6182017-09-15 17:33:55 -0700137}
138
Colin Crosscec81712017-07-13 14:43:27 -0700139var preDeps = []RegisterMutatorFunc{
Colin Crossae4c6182017-09-15 17:33:55 -0700140 registerArchMutator,
Colin Crosscec81712017-07-13 14:43:27 -0700141}
142
143var postDeps = []RegisterMutatorFunc{
Colin Cross1b488422019-03-04 22:33:56 -0800144 registerPathDepsMutator,
Colin Cross5ea9bcc2017-07-27 15:41:32 -0700145 RegisterPrebuiltsPostDepsMutators,
Paul Duffin593b3c92019-12-05 14:31:48 +0000146 RegisterVisibilityRuleEnforcer,
Artur Satayevc5570ac2020-04-09 16:06:36 +0100147 RegisterNeverallowMutator,
Jaewoong Jungb639a6a2019-05-10 15:16:29 -0700148 RegisterOverridePostDepsMutators,
Colin Crosscec81712017-07-13 14:43:27 -0700149}
Colin Cross1e676be2016-10-12 14:38:15 -0700150
Martin Stjernholm710ec3a2020-01-16 15:12:04 +0000151var finalDeps = []RegisterMutatorFunc{}
152
Colin Cross1e676be2016-10-12 14:38:15 -0700153func PreArchMutators(f RegisterMutatorFunc) {
154 preArch = append(preArch, f)
155}
156
157func PreDepsMutators(f RegisterMutatorFunc) {
158 preDeps = append(preDeps, f)
159}
160
161func PostDepsMutators(f RegisterMutatorFunc) {
162 postDeps = append(postDeps, f)
163}
164
Martin Stjernholm710ec3a2020-01-16 15:12:04 +0000165func FinalDepsMutators(f RegisterMutatorFunc) {
166 finalDeps = append(finalDeps, f)
167}
168
Colin Cross25de6c32019-06-06 14:29:25 -0700169type TopDownMutator func(TopDownMutatorContext)
Colin Cross6362e272015-10-29 15:25:03 -0700170
Colin Cross635c3b02016-05-18 15:37:25 -0700171type TopDownMutatorContext interface {
Colin Crossaabf6792017-11-29 00:27:14 -0800172 BaseModuleContext
Colin Cross3f68a132017-10-23 17:10:29 -0700173
Colin Crosscb55e082019-07-01 15:32:31 -0700174 MutatorName() string
175
Colin Cross3f68a132017-10-23 17:10:29 -0700176 Rename(name string)
Colin Cross3f68a132017-10-23 17:10:29 -0700177
Colin Crosse003c4a2019-09-25 12:58:36 -0700178 CreateModule(ModuleFactory, ...interface{}) Module
Colin Cross6362e272015-10-29 15:25:03 -0700179}
180
Colin Cross25de6c32019-06-06 14:29:25 -0700181type topDownMutatorContext struct {
Colin Crossdc35e212019-06-06 16:13:11 -0700182 bp blueprint.TopDownMutatorContext
Colin Cross0ea8ba82019-06-06 14:33:29 -0700183 baseModuleContext
Colin Cross6362e272015-10-29 15:25:03 -0700184}
185
Colin Cross25de6c32019-06-06 14:29:25 -0700186type BottomUpMutator func(BottomUpMutatorContext)
Colin Cross6362e272015-10-29 15:25:03 -0700187
Colin Cross635c3b02016-05-18 15:37:25 -0700188type BottomUpMutatorContext interface {
Colin Crossaabf6792017-11-29 00:27:14 -0800189 BaseModuleContext
Colin Crossaabf6792017-11-29 00:27:14 -0800190
Colin Crosscb55e082019-07-01 15:32:31 -0700191 MutatorName() string
192
Colin Crossaabf6792017-11-29 00:27:14 -0800193 Rename(name string)
Colin Crossaabf6792017-11-29 00:27:14 -0800194
195 AddDependency(module blueprint.Module, tag blueprint.DependencyTag, name ...string)
196 AddReverseDependency(module blueprint.Module, tag blueprint.DependencyTag, name string)
Colin Cross43b92e02019-11-18 15:28:57 -0800197 CreateVariations(...string) []Module
198 CreateLocalVariations(...string) []Module
Colin Crossaabf6792017-11-29 00:27:14 -0800199 SetDependencyVariation(string)
Jiyong Park1d1119f2019-07-29 21:27:18 +0900200 SetDefaultDependencyVariation(*string)
Colin Crossaabf6792017-11-29 00:27:14 -0800201 AddVariationDependencies([]blueprint.Variation, blueprint.DependencyTag, ...string)
202 AddFarVariationDependencies([]blueprint.Variation, blueprint.DependencyTag, ...string)
203 AddInterVariantDependency(tag blueprint.DependencyTag, from, to blueprint.Module)
204 ReplaceDependencies(string)
Jaewoong Jung9f88ce22019-11-15 10:57:34 -0800205 AliasVariation(variationName string)
Colin Cross6362e272015-10-29 15:25:03 -0700206}
207
Colin Cross25de6c32019-06-06 14:29:25 -0700208type bottomUpMutatorContext struct {
Colin Crossdc35e212019-06-06 16:13:11 -0700209 bp blueprint.BottomUpMutatorContext
Colin Cross0ea8ba82019-06-06 14:33:29 -0700210 baseModuleContext
Martin Stjernholm710ec3a2020-01-16 15:12:04 +0000211 finalPhase bool
Colin Cross6362e272015-10-29 15:25:03 -0700212}
213
Colin Cross25de6c32019-06-06 14:29:25 -0700214func (x *registerMutatorsContext) BottomUp(name string, m BottomUpMutator) MutatorHandle {
Martin Stjernholm710ec3a2020-01-16 15:12:04 +0000215 finalPhase := x.finalPhase
Colin Cross798bfce2016-10-12 14:28:16 -0700216 f := func(ctx blueprint.BottomUpMutatorContext) {
Colin Cross635c3b02016-05-18 15:37:25 -0700217 if a, ok := ctx.Module().(Module); ok {
Colin Cross25de6c32019-06-06 14:29:25 -0700218 actx := &bottomUpMutatorContext{
Colin Crossdc35e212019-06-06 16:13:11 -0700219 bp: ctx,
220 baseModuleContext: a.base().baseModuleContextFactory(ctx),
Martin Stjernholm710ec3a2020-01-16 15:12:04 +0000221 finalPhase: finalPhase,
Colin Cross6362e272015-10-29 15:25:03 -0700222 }
Colin Cross798bfce2016-10-12 14:28:16 -0700223 m(actx)
Colin Cross6362e272015-10-29 15:25:03 -0700224 }
Colin Cross798bfce2016-10-12 14:28:16 -0700225 }
226 mutator := &mutator{name: name, bottomUpMutator: f}
Colin Cross795c3772017-03-16 16:50:10 -0700227 x.mutators = append(x.mutators, mutator)
Colin Cross798bfce2016-10-12 14:28:16 -0700228 return mutator
Colin Cross6362e272015-10-29 15:25:03 -0700229}
230
Colin Cross25de6c32019-06-06 14:29:25 -0700231func (x *registerMutatorsContext) TopDown(name string, m TopDownMutator) MutatorHandle {
Colin Cross798bfce2016-10-12 14:28:16 -0700232 f := func(ctx blueprint.TopDownMutatorContext) {
Colin Cross635c3b02016-05-18 15:37:25 -0700233 if a, ok := ctx.Module().(Module); ok {
Colin Cross25de6c32019-06-06 14:29:25 -0700234 actx := &topDownMutatorContext{
Colin Crossdc35e212019-06-06 16:13:11 -0700235 bp: ctx,
236 baseModuleContext: a.base().baseModuleContextFactory(ctx),
Colin Cross6362e272015-10-29 15:25:03 -0700237 }
Colin Cross798bfce2016-10-12 14:28:16 -0700238 m(actx)
Colin Cross6362e272015-10-29 15:25:03 -0700239 }
Colin Cross798bfce2016-10-12 14:28:16 -0700240 }
241 mutator := &mutator{name: name, topDownMutator: f}
Colin Cross795c3772017-03-16 16:50:10 -0700242 x.mutators = append(x.mutators, mutator)
Colin Cross798bfce2016-10-12 14:28:16 -0700243 return mutator
244}
245
246type MutatorHandle interface {
247 Parallel() MutatorHandle
248}
249
250func (mutator *mutator) Parallel() MutatorHandle {
251 mutator.parallel = true
252 return mutator
Colin Cross6362e272015-10-29 15:25:03 -0700253}
Colin Cross1e676be2016-10-12 14:38:15 -0700254
255func depsMutator(ctx BottomUpMutatorContext) {
Colin Cross6db4a6a2018-08-30 12:52:41 -0700256 if m, ok := ctx.Module().(Module); ok && m.Enabled() {
Colin Cross1e676be2016-10-12 14:38:15 -0700257 m.DepsMutator(ctx)
258 }
259}
Colin Crossd11fcda2017-10-23 17:59:01 -0700260
Colin Cross25de6c32019-06-06 14:29:25 -0700261func (t *topDownMutatorContext) AppendProperties(props ...interface{}) {
Colin Cross519917d2017-11-02 16:35:56 -0700262 for _, p := range props {
Colin Cross25de6c32019-06-06 14:29:25 -0700263 err := proptools.AppendMatchingProperties(t.Module().base().customizableProperties,
Colin Cross519917d2017-11-02 16:35:56 -0700264 p, nil)
265 if err != nil {
266 if propertyErr, ok := err.(*proptools.ExtendPropertyError); ok {
Colin Cross25de6c32019-06-06 14:29:25 -0700267 t.PropertyErrorf(propertyErr.Property, "%s", propertyErr.Err.Error())
Colin Cross519917d2017-11-02 16:35:56 -0700268 } else {
269 panic(err)
270 }
271 }
272 }
273}
274
Colin Cross25de6c32019-06-06 14:29:25 -0700275func (t *topDownMutatorContext) PrependProperties(props ...interface{}) {
Colin Cross519917d2017-11-02 16:35:56 -0700276 for _, p := range props {
Colin Cross25de6c32019-06-06 14:29:25 -0700277 err := proptools.PrependMatchingProperties(t.Module().base().customizableProperties,
Colin Cross519917d2017-11-02 16:35:56 -0700278 p, nil)
279 if err != nil {
280 if propertyErr, ok := err.(*proptools.ExtendPropertyError); ok {
Colin Cross25de6c32019-06-06 14:29:25 -0700281 t.PropertyErrorf(propertyErr.Property, "%s", propertyErr.Err.Error())
Colin Cross519917d2017-11-02 16:35:56 -0700282 } else {
283 panic(err)
284 }
285 }
286 }
287}
Colin Crossdc35e212019-06-06 16:13:11 -0700288
289// android.topDownMutatorContext either has to embed blueprint.TopDownMutatorContext, in which case every method that
290// has an overridden version in android.BaseModuleContext has to be manually forwarded to BaseModuleContext to avoid
291// ambiguous method errors, or it has to store a blueprint.TopDownMutatorContext non-embedded, in which case every
292// non-overridden method has to be forwarded. There are fewer non-overridden methods, so use the latter. The following
293// methods forward to the identical blueprint versions for topDownMutatorContext and bottomUpMutatorContext.
294
Colin Crosscb55e082019-07-01 15:32:31 -0700295func (t *topDownMutatorContext) MutatorName() string {
296 return t.bp.MutatorName()
297}
298
Colin Crossdc35e212019-06-06 16:13:11 -0700299func (t *topDownMutatorContext) Rename(name string) {
300 t.bp.Rename(name)
Colin Cross9a362232019-07-01 15:32:45 -0700301 t.Module().base().commonProperties.DebugName = name
Colin Crossdc35e212019-06-06 16:13:11 -0700302}
303
Colin Crosse003c4a2019-09-25 12:58:36 -0700304func (t *topDownMutatorContext) CreateModule(factory ModuleFactory, props ...interface{}) Module {
Colin Cross18c46802019-09-24 22:19:02 -0700305 inherited := []interface{}{&t.Module().base().commonProperties}
Colin Crosse003c4a2019-09-25 12:58:36 -0700306 module := t.bp.CreateModule(ModuleFactoryAdaptor(factory), append(inherited, props...)...).(Module)
Colin Cross18c46802019-09-24 22:19:02 -0700307
308 if t.Module().base().variableProperties != nil && module.base().variableProperties != nil {
309 src := t.Module().base().variableProperties
310 dst := []interface{}{
311 module.base().variableProperties,
312 // Put an empty copy of the src properties into dst so that properties in src that are not in dst
313 // don't cause a "failed to find property to extend" error.
Colin Cross43e789d2020-01-28 09:46:50 -0800314 proptools.CloneEmptyProperties(reflect.ValueOf(src)).Interface(),
Colin Cross18c46802019-09-24 22:19:02 -0700315 }
316 err := proptools.AppendMatchingProperties(dst, src, nil)
317 if err != nil {
318 panic(err)
319 }
320 }
321
Colin Crosse003c4a2019-09-25 12:58:36 -0700322 return module
Colin Crossdc35e212019-06-06 16:13:11 -0700323}
324
Colin Crosscb55e082019-07-01 15:32:31 -0700325func (b *bottomUpMutatorContext) MutatorName() string {
326 return b.bp.MutatorName()
327}
328
Colin Crossdc35e212019-06-06 16:13:11 -0700329func (b *bottomUpMutatorContext) Rename(name string) {
330 b.bp.Rename(name)
Colin Cross9a362232019-07-01 15:32:45 -0700331 b.Module().base().commonProperties.DebugName = name
Colin Crossdc35e212019-06-06 16:13:11 -0700332}
333
334func (b *bottomUpMutatorContext) AddDependency(module blueprint.Module, tag blueprint.DependencyTag, name ...string) {
335 b.bp.AddDependency(module, tag, name...)
336}
337
338func (b *bottomUpMutatorContext) AddReverseDependency(module blueprint.Module, tag blueprint.DependencyTag, name string) {
339 b.bp.AddReverseDependency(module, tag, name)
340}
341
Colin Cross43b92e02019-11-18 15:28:57 -0800342func (b *bottomUpMutatorContext) CreateVariations(variations ...string) []Module {
Martin Stjernholm710ec3a2020-01-16 15:12:04 +0000343 if b.finalPhase {
344 panic("CreateVariations not allowed in FinalDepsMutators")
345 }
346
Colin Cross9a362232019-07-01 15:32:45 -0700347 modules := b.bp.CreateVariations(variations...)
348
Colin Cross43b92e02019-11-18 15:28:57 -0800349 aModules := make([]Module, len(modules))
Colin Cross9a362232019-07-01 15:32:45 -0700350 for i := range variations {
Colin Cross43b92e02019-11-18 15:28:57 -0800351 aModules[i] = modules[i].(Module)
352 base := aModules[i].base()
Colin Cross9a362232019-07-01 15:32:45 -0700353 base.commonProperties.DebugMutators = append(base.commonProperties.DebugMutators, b.MutatorName())
354 base.commonProperties.DebugVariations = append(base.commonProperties.DebugVariations, variations[i])
355 }
356
Colin Cross43b92e02019-11-18 15:28:57 -0800357 return aModules
Colin Crossdc35e212019-06-06 16:13:11 -0700358}
359
Colin Cross43b92e02019-11-18 15:28:57 -0800360func (b *bottomUpMutatorContext) CreateLocalVariations(variations ...string) []Module {
Martin Stjernholm710ec3a2020-01-16 15:12:04 +0000361 if b.finalPhase {
362 panic("CreateLocalVariations not allowed in FinalDepsMutators")
363 }
364
Colin Cross9a362232019-07-01 15:32:45 -0700365 modules := b.bp.CreateLocalVariations(variations...)
366
Colin Cross43b92e02019-11-18 15:28:57 -0800367 aModules := make([]Module, len(modules))
Colin Cross9a362232019-07-01 15:32:45 -0700368 for i := range variations {
Colin Cross43b92e02019-11-18 15:28:57 -0800369 aModules[i] = modules[i].(Module)
370 base := aModules[i].base()
Colin Cross9a362232019-07-01 15:32:45 -0700371 base.commonProperties.DebugMutators = append(base.commonProperties.DebugMutators, b.MutatorName())
372 base.commonProperties.DebugVariations = append(base.commonProperties.DebugVariations, variations[i])
373 }
374
Colin Cross43b92e02019-11-18 15:28:57 -0800375 return aModules
Colin Crossdc35e212019-06-06 16:13:11 -0700376}
377
378func (b *bottomUpMutatorContext) SetDependencyVariation(variation string) {
379 b.bp.SetDependencyVariation(variation)
380}
381
Jiyong Park1d1119f2019-07-29 21:27:18 +0900382func (b *bottomUpMutatorContext) SetDefaultDependencyVariation(variation *string) {
383 b.bp.SetDefaultDependencyVariation(variation)
384}
385
Colin Crossdc35e212019-06-06 16:13:11 -0700386func (b *bottomUpMutatorContext) AddVariationDependencies(variations []blueprint.Variation, tag blueprint.DependencyTag,
387 names ...string) {
388
389 b.bp.AddVariationDependencies(variations, tag, names...)
390}
391
392func (b *bottomUpMutatorContext) AddFarVariationDependencies(variations []blueprint.Variation,
393 tag blueprint.DependencyTag, names ...string) {
394
395 b.bp.AddFarVariationDependencies(variations, tag, names...)
396}
397
398func (b *bottomUpMutatorContext) AddInterVariantDependency(tag blueprint.DependencyTag, from, to blueprint.Module) {
399 b.bp.AddInterVariantDependency(tag, from, to)
400}
401
402func (b *bottomUpMutatorContext) ReplaceDependencies(name string) {
403 b.bp.ReplaceDependencies(name)
404}
Jaewoong Jung9f88ce22019-11-15 10:57:34 -0800405
406func (b *bottomUpMutatorContext) AliasVariation(variationName string) {
407 b.bp.AliasVariation(variationName)
408}