Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [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 | |
| 15 | package common |
| 16 | |
| 17 | import ( |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 18 | "path/filepath" |
Colin Cross | f6566ed | 2015-03-24 11:13:38 -0700 | [diff] [blame] | 19 | |
| 20 | "github.com/google/blueprint" |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 21 | ) |
| 22 | |
Colin Cross | 68f5510 | 2015-03-25 14:43:57 -0700 | [diff] [blame] | 23 | type Config interface { |
| 24 | CpPreserveSymlinksFlags() string |
| 25 | SrcDir() string |
| 26 | Getenv(string) string |
| 27 | EnvDeps() map[string]string |
Colin Cross | 35cec12 | 2015-04-02 14:37:16 -0700 | [diff] [blame] | 28 | DeviceOut() string |
| 29 | HostOut() string |
Colin Cross | 68f5510 | 2015-03-25 14:43:57 -0700 | [diff] [blame] | 30 | } |
| 31 | |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 32 | var ( |
| 33 | DeviceSharedLibrary = "shared_library" |
| 34 | DeviceStaticLibrary = "static_library" |
| 35 | DeviceExecutable = "executable" |
| 36 | HostSharedLibrary = "host_shared_library" |
| 37 | HostStaticLibrary = "host_static_library" |
| 38 | HostExecutable = "host_executable" |
| 39 | ) |
| 40 | |
Colin Cross | f6566ed | 2015-03-24 11:13:38 -0700 | [diff] [blame] | 41 | type androidBaseContext interface { |
| 42 | Arch() Arch |
| 43 | Host() bool |
| 44 | Device() bool |
| 45 | Debug() bool |
| 46 | } |
| 47 | |
| 48 | type AndroidBaseContext interface { |
| 49 | blueprint.BaseModuleContext |
| 50 | androidBaseContext |
| 51 | } |
| 52 | |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 53 | type AndroidModuleContext interface { |
| 54 | blueprint.ModuleContext |
Colin Cross | f6566ed | 2015-03-24 11:13:38 -0700 | [diff] [blame] | 55 | androidBaseContext |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 56 | |
Colin Cross | 35cec12 | 2015-04-02 14:37:16 -0700 | [diff] [blame] | 57 | InstallFile(installPath, srcPath string, deps ...string) string |
| 58 | InstallFileName(installPath, name, srcPath string, deps ...string) string |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 59 | CheckbuildFile(srcPath string) |
| 60 | } |
| 61 | |
| 62 | type AndroidModule interface { |
| 63 | blueprint.Module |
| 64 | |
| 65 | GenerateAndroidBuildActions(AndroidModuleContext) |
| 66 | |
| 67 | base() *AndroidModuleBase |
| 68 | Disabled() bool |
| 69 | HostOrDevice() HostOrDevice |
| 70 | } |
| 71 | |
| 72 | type AndroidDynamicDepender interface { |
| 73 | AndroidDynamicDependencies(ctx AndroidDynamicDependerModuleContext) []string |
| 74 | } |
| 75 | |
| 76 | type AndroidDynamicDependerModuleContext interface { |
| 77 | blueprint.DynamicDependerModuleContext |
Colin Cross | f6566ed | 2015-03-24 11:13:38 -0700 | [diff] [blame] | 78 | androidBaseContext |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | type commonProperties struct { |
Colin Cross | c77f9d1 | 2015-04-02 13:54:39 -0700 | [diff] [blame] | 82 | Name string |
| 83 | Deps []string |
| 84 | Tags []string |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 85 | |
| 86 | // disabled: don't emit any build rules for this module |
| 87 | Disabled bool `android:"arch_variant"` |
| 88 | |
| 89 | // multilib: control whether this module compiles for 32-bit, 64-bit, or both. Possible values |
| 90 | // are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both |
| 91 | // architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit |
| 92 | // platform |
| 93 | Compile_multilib string |
| 94 | |
| 95 | // Set by ArchMutator |
| 96 | CompileArch Arch `blueprint:"mutated"` |
| 97 | |
| 98 | // Set by InitAndroidModule |
| 99 | HostOrDeviceSupported HostOrDeviceSupported `blueprint:"mutated"` |
| 100 | } |
| 101 | |
| 102 | type hostAndDeviceProperties struct { |
| 103 | Host_supported bool |
| 104 | Device_supported bool |
| 105 | } |
| 106 | |
Colin Cross | c472d57 | 2015-03-17 15:06:21 -0700 | [diff] [blame] | 107 | type Multilib string |
| 108 | |
| 109 | const ( |
Colin Cross | 2fe6687 | 2015-03-30 17:20:39 -0700 | [diff] [blame^] | 110 | MultilibBoth Multilib = "both" |
| 111 | MultilibFirst Multilib = "first" |
| 112 | MultilibCommon Multilib = "common" |
Colin Cross | c472d57 | 2015-03-17 15:06:21 -0700 | [diff] [blame] | 113 | ) |
| 114 | |
Colin Cross | 5049f02 | 2015-03-18 13:28:46 -0700 | [diff] [blame] | 115 | func InitAndroidModule(m AndroidModule, |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 116 | propertyStructs ...interface{}) (blueprint.Module, []interface{}) { |
| 117 | |
| 118 | base := m.base() |
| 119 | base.module = m |
Colin Cross | 28d7659 | 2015-03-26 16:14:04 -0700 | [diff] [blame] | 120 | base.extendedProperties = make(map[string]struct{}) |
Colin Cross | 5049f02 | 2015-03-18 13:28:46 -0700 | [diff] [blame] | 121 | |
| 122 | propertyStructs = append(propertyStructs, &base.commonProperties) |
| 123 | |
| 124 | return m, propertyStructs |
| 125 | } |
| 126 | |
| 127 | func InitAndroidArchModule(m AndroidModule, hod HostOrDeviceSupported, defaultMultilib Multilib, |
| 128 | propertyStructs ...interface{}) (blueprint.Module, []interface{}) { |
| 129 | |
| 130 | _, propertyStructs = InitAndroidModule(m, propertyStructs...) |
| 131 | |
| 132 | base := m.base() |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 133 | base.commonProperties.HostOrDeviceSupported = hod |
| 134 | |
| 135 | if hod == HostAndDeviceSupported { |
| 136 | // Default to module to device supported, host not supported, can override in module |
| 137 | // properties |
| 138 | base.hostAndDeviceProperties.Device_supported = true |
| 139 | propertyStructs = append(propertyStructs, &base.hostAndDeviceProperties) |
| 140 | } |
| 141 | |
| 142 | return InitArchModule(m, defaultMultilib, propertyStructs...) |
| 143 | } |
| 144 | |
| 145 | // A AndroidModuleBase object contains the properties that are common to all Android |
| 146 | // modules. It should be included as an anonymous field in every module |
| 147 | // struct definition. InitAndroidModule should then be called from the module's |
| 148 | // factory function, and the return values from InitAndroidModule should be |
| 149 | // returned from the factory function. |
| 150 | // |
| 151 | // The AndroidModuleBase type is responsible for implementing the |
| 152 | // GenerateBuildActions method to support the blueprint.Module interface. This |
| 153 | // method will then call the module's GenerateAndroidBuildActions method once |
| 154 | // for each build variant that is to be built. GenerateAndroidBuildActions is |
| 155 | // passed a AndroidModuleContext rather than the usual blueprint.ModuleContext. |
| 156 | // AndroidModuleContext exposes extra functionality specific to the Android build |
| 157 | // system including details about the particular build variant that is to be |
| 158 | // generated. |
| 159 | // |
| 160 | // For example: |
| 161 | // |
| 162 | // import ( |
| 163 | // "android/soong/common" |
Colin Cross | 70b4059 | 2015-03-23 12:57:34 -0700 | [diff] [blame] | 164 | // "github.com/google/blueprint" |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 165 | // ) |
| 166 | // |
| 167 | // type myModule struct { |
| 168 | // common.AndroidModuleBase |
| 169 | // properties struct { |
| 170 | // MyProperty string |
| 171 | // } |
| 172 | // } |
| 173 | // |
| 174 | // func NewMyModule() (blueprint.Module, []interface{}) { |
| 175 | // m := &myModule{} |
| 176 | // return common.InitAndroidModule(m, &m.properties) |
| 177 | // } |
| 178 | // |
| 179 | // func (m *myModule) GenerateAndroidBuildActions(ctx common.AndroidModuleContext) { |
| 180 | // // Get the CPU architecture for the current build variant. |
| 181 | // variantArch := ctx.Arch() |
| 182 | // |
| 183 | // // ... |
| 184 | // } |
| 185 | type AndroidModuleBase struct { |
| 186 | // Putting the curiously recurring thing pointing to the thing that contains |
| 187 | // the thing pattern to good use. |
| 188 | module AndroidModule |
| 189 | |
| 190 | commonProperties commonProperties |
| 191 | hostAndDeviceProperties hostAndDeviceProperties |
| 192 | generalProperties []interface{} |
| 193 | archProperties []*archProperties |
Colin Cross | 28d7659 | 2015-03-26 16:14:04 -0700 | [diff] [blame] | 194 | extendedProperties map[string]struct{} |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 195 | |
| 196 | noAddressSanitizer bool |
| 197 | installFiles []string |
| 198 | checkbuildFiles []string |
| 199 | } |
| 200 | |
| 201 | func (a *AndroidModuleBase) base() *AndroidModuleBase { |
| 202 | return a |
| 203 | } |
| 204 | |
| 205 | func (a *AndroidModuleBase) SetArch(arch Arch) { |
| 206 | a.commonProperties.CompileArch = arch |
| 207 | } |
| 208 | |
| 209 | func (a *AndroidModuleBase) HostOrDevice() HostOrDevice { |
| 210 | return a.commonProperties.CompileArch.HostOrDevice |
| 211 | } |
| 212 | |
| 213 | func (a *AndroidModuleBase) HostSupported() bool { |
| 214 | return a.commonProperties.HostOrDeviceSupported == HostSupported || |
| 215 | a.commonProperties.HostOrDeviceSupported == HostAndDeviceSupported && |
| 216 | a.hostAndDeviceProperties.Host_supported |
| 217 | } |
| 218 | |
| 219 | func (a *AndroidModuleBase) DeviceSupported() bool { |
| 220 | return a.commonProperties.HostOrDeviceSupported == DeviceSupported || |
| 221 | a.commonProperties.HostOrDeviceSupported == HostAndDeviceSupported && |
| 222 | a.hostAndDeviceProperties.Device_supported |
| 223 | } |
| 224 | |
| 225 | func (a *AndroidModuleBase) Disabled() bool { |
| 226 | return a.commonProperties.Disabled |
| 227 | } |
| 228 | |
| 229 | func (a *AndroidModuleBase) computeInstallDeps( |
| 230 | ctx blueprint.ModuleContext) []string { |
| 231 | |
| 232 | result := []string{} |
| 233 | ctx.VisitDepsDepthFirstIf(isFileInstaller, |
| 234 | func(m blueprint.Module) { |
| 235 | fileInstaller := m.(fileInstaller) |
| 236 | files := fileInstaller.filesToInstall() |
| 237 | result = append(result, files...) |
| 238 | }) |
| 239 | |
| 240 | return result |
| 241 | } |
| 242 | |
| 243 | func (a *AndroidModuleBase) filesToInstall() []string { |
| 244 | return a.installFiles |
| 245 | } |
| 246 | |
| 247 | func (p *AndroidModuleBase) NoAddressSanitizer() bool { |
| 248 | return p.noAddressSanitizer |
| 249 | } |
| 250 | |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 251 | func (a *AndroidModuleBase) generateModuleTarget(ctx blueprint.ModuleContext) { |
| 252 | if a != ctx.FinalModule().(AndroidModule).base() { |
| 253 | return |
| 254 | } |
| 255 | |
| 256 | allInstalledFiles := []string{} |
Colin Cross | 9454bfa | 2015-03-17 13:24:18 -0700 | [diff] [blame] | 257 | allCheckbuildFiles := []string{} |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 258 | ctx.VisitAllModuleVariants(func(module blueprint.Module) { |
Colin Cross | c940435 | 2015-03-26 16:10:12 -0700 | [diff] [blame] | 259 | a := module.(AndroidModule).base() |
| 260 | allInstalledFiles = append(allInstalledFiles, a.installFiles...) |
| 261 | allCheckbuildFiles = append(allCheckbuildFiles, a.checkbuildFiles...) |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 262 | }) |
| 263 | |
Colin Cross | 9454bfa | 2015-03-17 13:24:18 -0700 | [diff] [blame] | 264 | deps := []string{} |
| 265 | |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 266 | if len(allInstalledFiles) > 0 { |
Colin Cross | 9454bfa | 2015-03-17 13:24:18 -0700 | [diff] [blame] | 267 | name := ctx.ModuleName() + "-install" |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 268 | ctx.Build(pctx, blueprint.BuildParams{ |
Colin Cross | 9454bfa | 2015-03-17 13:24:18 -0700 | [diff] [blame] | 269 | Rule: blueprint.Phony, |
| 270 | Outputs: []string{name}, |
| 271 | Implicits: allInstalledFiles, |
| 272 | }) |
| 273 | deps = append(deps, name) |
| 274 | } |
| 275 | |
| 276 | if len(allCheckbuildFiles) > 0 { |
| 277 | name := ctx.ModuleName() + "-checkbuild" |
| 278 | ctx.Build(pctx, blueprint.BuildParams{ |
| 279 | Rule: blueprint.Phony, |
| 280 | Outputs: []string{name}, |
| 281 | Implicits: allCheckbuildFiles, |
| 282 | Optional: true, |
| 283 | }) |
| 284 | deps = append(deps, name) |
| 285 | } |
| 286 | |
| 287 | if len(deps) > 0 { |
| 288 | ctx.Build(pctx, blueprint.BuildParams{ |
| 289 | Rule: blueprint.Phony, |
| 290 | Outputs: []string{ctx.ModuleName()}, |
| 291 | Implicits: deps, |
| 292 | Optional: true, |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 293 | }) |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | func (a *AndroidModuleBase) DynamicDependencies(ctx blueprint.DynamicDependerModuleContext) []string { |
| 298 | actx := &androidDynamicDependerContext{ |
| 299 | DynamicDependerModuleContext: ctx, |
Colin Cross | f6566ed | 2015-03-24 11:13:38 -0700 | [diff] [blame] | 300 | androidBaseContextImpl: androidBaseContextImpl{ |
| 301 | arch: a.commonProperties.CompileArch, |
| 302 | }, |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 303 | } |
| 304 | |
| 305 | if dynamic, ok := a.module.(AndroidDynamicDepender); ok { |
| 306 | return dynamic.AndroidDynamicDependencies(actx) |
| 307 | } |
| 308 | |
| 309 | return nil |
| 310 | } |
| 311 | |
| 312 | func (a *AndroidModuleBase) GenerateBuildActions(ctx blueprint.ModuleContext) { |
| 313 | androidCtx := &androidModuleContext{ |
| 314 | ModuleContext: ctx, |
Colin Cross | f6566ed | 2015-03-24 11:13:38 -0700 | [diff] [blame] | 315 | androidBaseContextImpl: androidBaseContextImpl{ |
| 316 | arch: a.commonProperties.CompileArch, |
| 317 | }, |
Colin Cross | 28d7659 | 2015-03-26 16:14:04 -0700 | [diff] [blame] | 318 | installDeps: a.computeInstallDeps(ctx), |
| 319 | installFiles: a.installFiles, |
| 320 | extendedProperties: a.extendedProperties, |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 321 | } |
| 322 | |
| 323 | if a.commonProperties.Disabled { |
| 324 | return |
| 325 | } |
| 326 | |
| 327 | a.module.GenerateAndroidBuildActions(androidCtx) |
| 328 | if ctx.Failed() { |
| 329 | return |
| 330 | } |
| 331 | |
Colin Cross | c940435 | 2015-03-26 16:10:12 -0700 | [diff] [blame] | 332 | a.installFiles = append(a.installFiles, androidCtx.installFiles...) |
| 333 | a.checkbuildFiles = append(a.checkbuildFiles, androidCtx.checkbuildFiles...) |
| 334 | |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 335 | a.generateModuleTarget(ctx) |
| 336 | if ctx.Failed() { |
| 337 | return |
| 338 | } |
| 339 | } |
| 340 | |
Colin Cross | f6566ed | 2015-03-24 11:13:38 -0700 | [diff] [blame] | 341 | type androidBaseContextImpl struct { |
| 342 | arch Arch |
| 343 | debug bool |
| 344 | } |
| 345 | |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 346 | type androidModuleContext struct { |
| 347 | blueprint.ModuleContext |
Colin Cross | f6566ed | 2015-03-24 11:13:38 -0700 | [diff] [blame] | 348 | androidBaseContextImpl |
Colin Cross | 28d7659 | 2015-03-26 16:14:04 -0700 | [diff] [blame] | 349 | installDeps []string |
| 350 | installFiles []string |
| 351 | checkbuildFiles []string |
| 352 | extendedProperties map[string]struct{} |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 353 | } |
| 354 | |
| 355 | func (a *androidModuleContext) Build(pctx *blueprint.PackageContext, params blueprint.BuildParams) { |
| 356 | params.Optional = true |
| 357 | a.ModuleContext.Build(pctx, params) |
| 358 | } |
| 359 | |
Colin Cross | 28d7659 | 2015-03-26 16:14:04 -0700 | [diff] [blame] | 360 | func (a *androidModuleContext) ContainsProperty(property string) bool { |
| 361 | if a.ModuleContext.ContainsProperty(property) { |
| 362 | return true |
| 363 | } |
| 364 | _, ok := a.extendedProperties[property] |
| 365 | return ok |
| 366 | } |
| 367 | |
Colin Cross | f6566ed | 2015-03-24 11:13:38 -0700 | [diff] [blame] | 368 | func (a *androidBaseContextImpl) Arch() Arch { |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 369 | return a.arch |
| 370 | } |
| 371 | |
Colin Cross | f6566ed | 2015-03-24 11:13:38 -0700 | [diff] [blame] | 372 | func (a *androidBaseContextImpl) Host() bool { |
| 373 | return a.arch.HostOrDevice.Host() |
| 374 | } |
| 375 | |
| 376 | func (a *androidBaseContextImpl) Device() bool { |
| 377 | return a.arch.HostOrDevice.Device() |
| 378 | } |
| 379 | |
| 380 | func (a *androidBaseContextImpl) Debug() bool { |
| 381 | return a.debug |
| 382 | } |
| 383 | |
Colin Cross | 35cec12 | 2015-04-02 14:37:16 -0700 | [diff] [blame] | 384 | func (a *androidModuleContext) InstallFileName(installPath, name, srcPath string, |
| 385 | deps ...string) string { |
| 386 | |
| 387 | config := a.Config().(Config) |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 388 | var fullInstallPath string |
| 389 | if a.arch.HostOrDevice.Device() { |
| 390 | // TODO: replace unset with a device name once we have device targeting |
Colin Cross | 35cec12 | 2015-04-02 14:37:16 -0700 | [diff] [blame] | 391 | fullInstallPath = filepath.Join(config.DeviceOut(), "system", |
| 392 | installPath, name) |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 393 | } else { |
Colin Cross | 35cec12 | 2015-04-02 14:37:16 -0700 | [diff] [blame] | 394 | fullInstallPath = filepath.Join(config.HostOut(), installPath, name) |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 395 | } |
| 396 | |
Colin Cross | 35cec12 | 2015-04-02 14:37:16 -0700 | [diff] [blame] | 397 | deps = append(deps, a.installDeps...) |
| 398 | |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 399 | a.ModuleContext.Build(pctx, blueprint.BuildParams{ |
| 400 | Rule: Cp, |
| 401 | Outputs: []string{fullInstallPath}, |
| 402 | Inputs: []string{srcPath}, |
Colin Cross | 35cec12 | 2015-04-02 14:37:16 -0700 | [diff] [blame] | 403 | OrderOnly: deps, |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 404 | }) |
| 405 | |
| 406 | a.installFiles = append(a.installFiles, fullInstallPath) |
Colin Cross | 35cec12 | 2015-04-02 14:37:16 -0700 | [diff] [blame] | 407 | return fullInstallPath |
| 408 | } |
| 409 | |
| 410 | func (a *androidModuleContext) InstallFile(installPath, srcPath string, deps ...string) string { |
| 411 | return a.InstallFileName(installPath, filepath.Base(srcPath), srcPath, deps...) |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 412 | } |
| 413 | |
| 414 | func (a *androidModuleContext) CheckbuildFile(srcPath string) { |
| 415 | a.checkbuildFiles = append(a.checkbuildFiles, srcPath) |
| 416 | } |
| 417 | |
| 418 | type androidDynamicDependerContext struct { |
| 419 | blueprint.DynamicDependerModuleContext |
Colin Cross | f6566ed | 2015-03-24 11:13:38 -0700 | [diff] [blame] | 420 | androidBaseContextImpl |
Colin Cross | 3f40fa4 | 2015-01-30 17:27:36 -0800 | [diff] [blame] | 421 | } |
| 422 | |
| 423 | type fileInstaller interface { |
| 424 | filesToInstall() []string |
| 425 | } |
| 426 | |
| 427 | func isFileInstaller(m blueprint.Module) bool { |
| 428 | _, ok := m.(fileInstaller) |
| 429 | return ok |
| 430 | } |
| 431 | |
| 432 | func isAndroidModule(m blueprint.Module) bool { |
| 433 | _, ok := m.(AndroidModule) |
| 434 | return ok |
| 435 | } |