Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 1 | // 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 Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 15 | package android |
Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 16 | |
Colin Cross | 795c377 | 2017-03-16 16:50:10 -0700 | [diff] [blame] | 17 | import ( |
Colin Cross | 795c377 | 2017-03-16 16:50:10 -0700 | [diff] [blame] | 18 | "github.com/google/blueprint" |
Colin Cross | 519917d | 2017-11-02 16:35:56 -0700 | [diff] [blame] | 19 | "github.com/google/blueprint/proptools" |
Colin Cross | 795c377 | 2017-03-16 16:50:10 -0700 | [diff] [blame] | 20 | ) |
Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 21 | |
Jeff Gaston | af3cc2d | 2017-09-27 17:01:44 -0700 | [diff] [blame] | 22 | // Phases: |
| 23 | // run Pre-arch mutators |
| 24 | // run archMutator |
| 25 | // run Pre-deps mutators |
| 26 | // run depsMutator |
| 27 | // run PostDeps mutators |
| 28 | // continue on to GenerateAndroidBuildActions |
Colin Cross | 1e676be | 2016-10-12 14:38:15 -0700 | [diff] [blame] | 29 | |
Colin Cross | 795c377 | 2017-03-16 16:50:10 -0700 | [diff] [blame] | 30 | func registerMutatorsToContext(ctx *blueprint.Context, mutators []*mutator) { |
| 31 | for _, t := range mutators { |
| 32 | var handle blueprint.MutatorHandle |
| 33 | if t.bottomUpMutator != nil { |
| 34 | handle = ctx.RegisterBottomUpMutator(t.name, t.bottomUpMutator) |
| 35 | } else if t.topDownMutator != nil { |
| 36 | handle = ctx.RegisterTopDownMutator(t.name, t.topDownMutator) |
| 37 | } |
| 38 | if t.parallel { |
| 39 | handle.Parallel() |
Colin Cross | 1e676be | 2016-10-12 14:38:15 -0700 | [diff] [blame] | 40 | } |
| 41 | } |
Colin Cross | 1e676be | 2016-10-12 14:38:15 -0700 | [diff] [blame] | 42 | } |
| 43 | |
Colin Cross | cec8171 | 2017-07-13 14:43:27 -0700 | [diff] [blame] | 44 | func registerMutators(ctx *blueprint.Context, preArch, preDeps, postDeps []RegisterMutatorFunc) { |
| 45 | mctx := ®isterMutatorsContext{} |
Nan Zhang | db0b9a3 | 2017-02-27 10:12:13 -0800 | [diff] [blame] | 46 | |
| 47 | register := func(funcs []RegisterMutatorFunc) { |
| 48 | for _, f := range funcs { |
Colin Cross | cec8171 | 2017-07-13 14:43:27 -0700 | [diff] [blame] | 49 | f(mctx) |
Nan Zhang | db0b9a3 | 2017-02-27 10:12:13 -0800 | [diff] [blame] | 50 | } |
| 51 | } |
| 52 | |
Colin Cross | cec8171 | 2017-07-13 14:43:27 -0700 | [diff] [blame] | 53 | register(preArch) |
Nan Zhang | db0b9a3 | 2017-02-27 10:12:13 -0800 | [diff] [blame] | 54 | |
Colin Cross | cec8171 | 2017-07-13 14:43:27 -0700 | [diff] [blame] | 55 | register(preDeps) |
| 56 | |
| 57 | mctx.BottomUp("deps", depsMutator).Parallel() |
| 58 | |
| 59 | register(postDeps) |
| 60 | |
| 61 | registerMutatorsToContext(ctx, mctx.mutators) |
Colin Cross | 795c377 | 2017-03-16 16:50:10 -0700 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | type registerMutatorsContext struct { |
| 65 | mutators []*mutator |
| 66 | } |
Colin Cross | 1e676be | 2016-10-12 14:38:15 -0700 | [diff] [blame] | 67 | |
| 68 | type RegisterMutatorsContext interface { |
| 69 | TopDown(name string, m AndroidTopDownMutator) MutatorHandle |
| 70 | BottomUp(name string, m AndroidBottomUpMutator) MutatorHandle |
| 71 | } |
| 72 | |
| 73 | type RegisterMutatorFunc func(RegisterMutatorsContext) |
| 74 | |
Colin Cross | cec8171 | 2017-07-13 14:43:27 -0700 | [diff] [blame] | 75 | var preArch = []RegisterMutatorFunc{ |
| 76 | func(ctx RegisterMutatorsContext) { |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 77 | ctx.TopDown("load_hooks", LoadHookMutator).Parallel() |
Colin Cross | cec8171 | 2017-07-13 14:43:27 -0700 | [diff] [blame] | 78 | }, |
Dan Willemsen | 6e72ef7 | 2018-01-26 18:27:02 -0800 | [diff] [blame] | 79 | RegisterNamespaceMutator, |
Colin Cross | 5ea9bcc | 2017-07-27 15:41:32 -0700 | [diff] [blame] | 80 | RegisterPrebuiltsPreArchMutators, |
Colin Cross | 89536d4 | 2017-07-07 14:35:50 -0700 | [diff] [blame] | 81 | RegisterDefaultsPreArchMutators, |
Colin Cross | cec8171 | 2017-07-13 14:43:27 -0700 | [diff] [blame] | 82 | } |
| 83 | |
Colin Cross | ae4c618 | 2017-09-15 17:33:55 -0700 | [diff] [blame] | 84 | func registerArchMutator(ctx RegisterMutatorsContext) { |
| 85 | ctx.BottomUp("arch", archMutator).Parallel() |
| 86 | ctx.TopDown("arch_hooks", archHookMutator).Parallel() |
| 87 | } |
| 88 | |
Colin Cross | cec8171 | 2017-07-13 14:43:27 -0700 | [diff] [blame] | 89 | var preDeps = []RegisterMutatorFunc{ |
Colin Cross | ae4c618 | 2017-09-15 17:33:55 -0700 | [diff] [blame] | 90 | registerArchMutator, |
Colin Cross | cec8171 | 2017-07-13 14:43:27 -0700 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | var postDeps = []RegisterMutatorFunc{ |
Colin Cross | 5ea9bcc | 2017-07-27 15:41:32 -0700 | [diff] [blame] | 94 | RegisterPrebuiltsPostDepsMutators, |
Steven Moreland | 65b3fd9 | 2017-12-06 14:18:35 -0800 | [diff] [blame] | 95 | registerNeverallowMutator, |
Colin Cross | cec8171 | 2017-07-13 14:43:27 -0700 | [diff] [blame] | 96 | } |
Colin Cross | 1e676be | 2016-10-12 14:38:15 -0700 | [diff] [blame] | 97 | |
| 98 | func PreArchMutators(f RegisterMutatorFunc) { |
| 99 | preArch = append(preArch, f) |
| 100 | } |
| 101 | |
| 102 | func PreDepsMutators(f RegisterMutatorFunc) { |
| 103 | preDeps = append(preDeps, f) |
| 104 | } |
| 105 | |
| 106 | func PostDepsMutators(f RegisterMutatorFunc) { |
| 107 | postDeps = append(postDeps, f) |
| 108 | } |
| 109 | |
Colin Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 110 | type AndroidTopDownMutator func(TopDownMutatorContext) |
Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 111 | |
Colin Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 112 | type TopDownMutatorContext interface { |
Colin Cross | aabf679 | 2017-11-29 00:27:14 -0800 | [diff] [blame] | 113 | BaseModuleContext |
Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 114 | androidBaseContext |
Colin Cross | 3f68a13 | 2017-10-23 17:10:29 -0700 | [diff] [blame] | 115 | |
| 116 | OtherModuleExists(name string) bool |
| 117 | Rename(name string) |
Colin Cross | 519917d | 2017-11-02 16:35:56 -0700 | [diff] [blame] | 118 | Module() Module |
Colin Cross | 3f68a13 | 2017-10-23 17:10:29 -0700 | [diff] [blame] | 119 | |
| 120 | OtherModuleName(m blueprint.Module) string |
| 121 | OtherModuleErrorf(m blueprint.Module, fmt string, args ...interface{}) |
| 122 | OtherModuleDependencyTag(m blueprint.Module) blueprint.DependencyTag |
| 123 | |
| 124 | CreateModule(blueprint.ModuleFactory, ...interface{}) |
| 125 | |
| 126 | GetDirectDepWithTag(name string, tag blueprint.DependencyTag) blueprint.Module |
| 127 | GetDirectDep(name string) (blueprint.Module, blueprint.DependencyTag) |
| 128 | |
Colin Cross | d11fcda | 2017-10-23 17:59:01 -0700 | [diff] [blame] | 129 | VisitDirectDeps(visit func(Module)) |
Colin Cross | ee6143c | 2017-12-30 17:54:27 -0800 | [diff] [blame] | 130 | VisitDirectDepsWithTag(tag blueprint.DependencyTag, visit func(Module)) |
Colin Cross | d11fcda | 2017-10-23 17:59:01 -0700 | [diff] [blame] | 131 | VisitDirectDepsIf(pred func(Module) bool, visit func(Module)) |
| 132 | VisitDepsDepthFirst(visit func(Module)) |
| 133 | VisitDepsDepthFirstIf(pred func(Module) bool, visit func(Module)) |
| 134 | WalkDeps(visit func(Module, Module) bool) |
Jooyung Han | a70f067 | 2019-01-18 15:20:43 +0900 | [diff] [blame^] | 135 | // GetWalkPath is supposed to be called in visit function passed in WalkDeps() |
| 136 | // and returns a top-down dependency path from a start module to current child module. |
| 137 | GetWalkPath() []Module |
Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 138 | } |
| 139 | |
| 140 | type androidTopDownMutatorContext struct { |
| 141 | blueprint.TopDownMutatorContext |
| 142 | androidBaseContextImpl |
Jooyung Han | a70f067 | 2019-01-18 15:20:43 +0900 | [diff] [blame^] | 143 | walkPath []Module |
Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 144 | } |
| 145 | |
Colin Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 146 | type AndroidBottomUpMutator func(BottomUpMutatorContext) |
Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 147 | |
Colin Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 148 | type BottomUpMutatorContext interface { |
Colin Cross | aabf679 | 2017-11-29 00:27:14 -0800 | [diff] [blame] | 149 | BaseModuleContext |
Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 150 | androidBaseContext |
Colin Cross | aabf679 | 2017-11-29 00:27:14 -0800 | [diff] [blame] | 151 | |
| 152 | OtherModuleExists(name string) bool |
| 153 | Rename(name string) |
| 154 | Module() blueprint.Module |
| 155 | |
| 156 | AddDependency(module blueprint.Module, tag blueprint.DependencyTag, name ...string) |
| 157 | AddReverseDependency(module blueprint.Module, tag blueprint.DependencyTag, name string) |
| 158 | CreateVariations(...string) []blueprint.Module |
| 159 | CreateLocalVariations(...string) []blueprint.Module |
| 160 | SetDependencyVariation(string) |
| 161 | AddVariationDependencies([]blueprint.Variation, blueprint.DependencyTag, ...string) |
| 162 | AddFarVariationDependencies([]blueprint.Variation, blueprint.DependencyTag, ...string) |
| 163 | AddInterVariantDependency(tag blueprint.DependencyTag, from, to blueprint.Module) |
| 164 | ReplaceDependencies(string) |
Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 165 | } |
| 166 | |
| 167 | type androidBottomUpMutatorContext struct { |
| 168 | blueprint.BottomUpMutatorContext |
| 169 | androidBaseContextImpl |
| 170 | } |
| 171 | |
Colin Cross | 795c377 | 2017-03-16 16:50:10 -0700 | [diff] [blame] | 172 | func (x *registerMutatorsContext) BottomUp(name string, m AndroidBottomUpMutator) MutatorHandle { |
Colin Cross | 798bfce | 2016-10-12 14:28:16 -0700 | [diff] [blame] | 173 | f := func(ctx blueprint.BottomUpMutatorContext) { |
Colin Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 174 | if a, ok := ctx.Module().(Module); ok { |
Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 175 | actx := &androidBottomUpMutatorContext{ |
| 176 | BottomUpMutatorContext: ctx, |
| 177 | androidBaseContextImpl: a.base().androidBaseContextFactory(ctx), |
| 178 | } |
Colin Cross | 798bfce | 2016-10-12 14:28:16 -0700 | [diff] [blame] | 179 | m(actx) |
Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 180 | } |
Colin Cross | 798bfce | 2016-10-12 14:28:16 -0700 | [diff] [blame] | 181 | } |
| 182 | mutator := &mutator{name: name, bottomUpMutator: f} |
Colin Cross | 795c377 | 2017-03-16 16:50:10 -0700 | [diff] [blame] | 183 | x.mutators = append(x.mutators, mutator) |
Colin Cross | 798bfce | 2016-10-12 14:28:16 -0700 | [diff] [blame] | 184 | return mutator |
Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 185 | } |
| 186 | |
Colin Cross | 795c377 | 2017-03-16 16:50:10 -0700 | [diff] [blame] | 187 | func (x *registerMutatorsContext) TopDown(name string, m AndroidTopDownMutator) MutatorHandle { |
Colin Cross | 798bfce | 2016-10-12 14:28:16 -0700 | [diff] [blame] | 188 | f := func(ctx blueprint.TopDownMutatorContext) { |
Colin Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 189 | if a, ok := ctx.Module().(Module); ok { |
Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 190 | actx := &androidTopDownMutatorContext{ |
| 191 | TopDownMutatorContext: ctx, |
| 192 | androidBaseContextImpl: a.base().androidBaseContextFactory(ctx), |
| 193 | } |
Colin Cross | 798bfce | 2016-10-12 14:28:16 -0700 | [diff] [blame] | 194 | m(actx) |
Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 195 | } |
Colin Cross | 798bfce | 2016-10-12 14:28:16 -0700 | [diff] [blame] | 196 | } |
| 197 | mutator := &mutator{name: name, topDownMutator: f} |
Colin Cross | 795c377 | 2017-03-16 16:50:10 -0700 | [diff] [blame] | 198 | x.mutators = append(x.mutators, mutator) |
Colin Cross | 798bfce | 2016-10-12 14:28:16 -0700 | [diff] [blame] | 199 | return mutator |
| 200 | } |
| 201 | |
| 202 | type MutatorHandle interface { |
| 203 | Parallel() MutatorHandle |
| 204 | } |
| 205 | |
| 206 | func (mutator *mutator) Parallel() MutatorHandle { |
| 207 | mutator.parallel = true |
| 208 | return mutator |
Colin Cross | 6362e27 | 2015-10-29 15:25:03 -0700 | [diff] [blame] | 209 | } |
Colin Cross | 1e676be | 2016-10-12 14:38:15 -0700 | [diff] [blame] | 210 | |
| 211 | func depsMutator(ctx BottomUpMutatorContext) { |
Colin Cross | 6db4a6a | 2018-08-30 12:52:41 -0700 | [diff] [blame] | 212 | if m, ok := ctx.Module().(Module); ok && m.Enabled() { |
Colin Cross | 1e676be | 2016-10-12 14:38:15 -0700 | [diff] [blame] | 213 | m.DepsMutator(ctx) |
Jaewoong Jung | 62707f7 | 2018-11-16 13:26:43 -0800 | [diff] [blame] | 214 | |
| 215 | // For filegroup-based notice file references. |
| 216 | if m.base().commonProperties.Notice != nil { |
| 217 | ExtractSourceDeps(ctx, m.base().commonProperties.Notice) |
| 218 | } |
Colin Cross | 1e676be | 2016-10-12 14:38:15 -0700 | [diff] [blame] | 219 | } |
| 220 | } |
Colin Cross | d11fcda | 2017-10-23 17:59:01 -0700 | [diff] [blame] | 221 | |
Colin Cross | aabf679 | 2017-11-29 00:27:14 -0800 | [diff] [blame] | 222 | func (a *androidTopDownMutatorContext) Config() Config { |
| 223 | return a.config |
| 224 | } |
| 225 | |
| 226 | func (a *androidBottomUpMutatorContext) Config() Config { |
| 227 | return a.config |
| 228 | } |
| 229 | |
Colin Cross | 519917d | 2017-11-02 16:35:56 -0700 | [diff] [blame] | 230 | func (a *androidTopDownMutatorContext) Module() Module { |
| 231 | module, _ := a.TopDownMutatorContext.Module().(Module) |
| 232 | return module |
| 233 | } |
| 234 | |
Colin Cross | d11fcda | 2017-10-23 17:59:01 -0700 | [diff] [blame] | 235 | func (a *androidTopDownMutatorContext) VisitDirectDeps(visit func(Module)) { |
| 236 | a.TopDownMutatorContext.VisitDirectDeps(func(module blueprint.Module) { |
| 237 | if aModule, _ := module.(Module); aModule != nil { |
| 238 | visit(aModule) |
| 239 | } |
| 240 | }) |
| 241 | } |
| 242 | |
Colin Cross | ee6143c | 2017-12-30 17:54:27 -0800 | [diff] [blame] | 243 | func (a *androidTopDownMutatorContext) VisitDirectDepsWithTag(tag blueprint.DependencyTag, visit func(Module)) { |
| 244 | a.TopDownMutatorContext.VisitDirectDeps(func(module blueprint.Module) { |
| 245 | if aModule, _ := module.(Module); aModule != nil { |
| 246 | if a.TopDownMutatorContext.OtherModuleDependencyTag(aModule) == tag { |
| 247 | visit(aModule) |
| 248 | } |
| 249 | } |
| 250 | }) |
| 251 | } |
| 252 | |
Colin Cross | d11fcda | 2017-10-23 17:59:01 -0700 | [diff] [blame] | 253 | func (a *androidTopDownMutatorContext) VisitDirectDepsIf(pred func(Module) bool, visit func(Module)) { |
| 254 | a.TopDownMutatorContext.VisitDirectDepsIf( |
| 255 | // pred |
| 256 | func(module blueprint.Module) bool { |
| 257 | if aModule, _ := module.(Module); aModule != nil { |
| 258 | return pred(aModule) |
| 259 | } else { |
| 260 | return false |
| 261 | } |
| 262 | }, |
| 263 | // visit |
| 264 | func(module blueprint.Module) { |
| 265 | visit(module.(Module)) |
| 266 | }) |
| 267 | } |
| 268 | |
| 269 | func (a *androidTopDownMutatorContext) VisitDepsDepthFirst(visit func(Module)) { |
| 270 | a.TopDownMutatorContext.VisitDepsDepthFirst(func(module blueprint.Module) { |
| 271 | if aModule, _ := module.(Module); aModule != nil { |
| 272 | visit(aModule) |
| 273 | } |
| 274 | }) |
| 275 | } |
| 276 | |
| 277 | func (a *androidTopDownMutatorContext) VisitDepsDepthFirstIf(pred func(Module) bool, visit func(Module)) { |
| 278 | a.TopDownMutatorContext.VisitDepsDepthFirstIf( |
| 279 | // pred |
| 280 | func(module blueprint.Module) bool { |
| 281 | if aModule, _ := module.(Module); aModule != nil { |
| 282 | return pred(aModule) |
| 283 | } else { |
| 284 | return false |
| 285 | } |
| 286 | }, |
| 287 | // visit |
| 288 | func(module blueprint.Module) { |
| 289 | visit(module.(Module)) |
| 290 | }) |
| 291 | } |
| 292 | |
| 293 | func (a *androidTopDownMutatorContext) WalkDeps(visit func(Module, Module) bool) { |
Jooyung Han | a70f067 | 2019-01-18 15:20:43 +0900 | [diff] [blame^] | 294 | a.walkPath = []Module{a.Module()} |
Colin Cross | d11fcda | 2017-10-23 17:59:01 -0700 | [diff] [blame] | 295 | a.TopDownMutatorContext.WalkDeps(func(child, parent blueprint.Module) bool { |
| 296 | childAndroidModule, _ := child.(Module) |
| 297 | parentAndroidModule, _ := parent.(Module) |
| 298 | if childAndroidModule != nil && parentAndroidModule != nil { |
Jooyung Han | a70f067 | 2019-01-18 15:20:43 +0900 | [diff] [blame^] | 299 | // record walkPath before visit |
| 300 | for a.walkPath[len(a.walkPath)-1] != parentAndroidModule { |
| 301 | a.walkPath = a.walkPath[0 : len(a.walkPath)-1] |
| 302 | } |
| 303 | a.walkPath = append(a.walkPath, childAndroidModule) |
Colin Cross | d11fcda | 2017-10-23 17:59:01 -0700 | [diff] [blame] | 304 | return visit(childAndroidModule, parentAndroidModule) |
| 305 | } else { |
| 306 | return false |
| 307 | } |
| 308 | }) |
| 309 | } |
Colin Cross | 519917d | 2017-11-02 16:35:56 -0700 | [diff] [blame] | 310 | |
Jooyung Han | a70f067 | 2019-01-18 15:20:43 +0900 | [diff] [blame^] | 311 | func (a *androidTopDownMutatorContext) GetWalkPath() []Module { |
| 312 | return a.walkPath |
| 313 | } |
| 314 | |
Colin Cross | 519917d | 2017-11-02 16:35:56 -0700 | [diff] [blame] | 315 | func (a *androidTopDownMutatorContext) AppendProperties(props ...interface{}) { |
| 316 | for _, p := range props { |
| 317 | err := proptools.AppendMatchingProperties(a.Module().base().customizableProperties, |
| 318 | p, nil) |
| 319 | if err != nil { |
| 320 | if propertyErr, ok := err.(*proptools.ExtendPropertyError); ok { |
| 321 | a.PropertyErrorf(propertyErr.Property, "%s", propertyErr.Err.Error()) |
| 322 | } else { |
| 323 | panic(err) |
| 324 | } |
| 325 | } |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | func (a *androidTopDownMutatorContext) PrependProperties(props ...interface{}) { |
| 330 | for _, p := range props { |
| 331 | err := proptools.PrependMatchingProperties(a.Module().base().customizableProperties, |
| 332 | p, nil) |
| 333 | if err != nil { |
| 334 | if propertyErr, ok := err.(*proptools.ExtendPropertyError); ok { |
| 335 | a.PropertyErrorf(propertyErr.Property, "%s", propertyErr.Err.Error()) |
| 336 | } else { |
| 337 | panic(err) |
| 338 | } |
| 339 | } |
| 340 | } |
| 341 | } |