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