Add DeviceConfig and OncePer objects

Add DeviceConfig to store per-device configuration information.  Put a
OncePer object inside Config and DeviceConfig, which computes a value
once per key per object to allow build logic to store arbitrary
per-build or per-device computed values.

Change-Id: I1a38b426f29d223ef5e803e0d4d9604500de2fd2
This commit is contained in:
Colin Cross
2016-08-17 15:24:12 -07:00
parent 389d2bb145
commit 9272ade7a8
5 changed files with 123 additions and 12 deletions

View File

@@ -56,6 +56,7 @@ type androidBaseContext interface {
Darwin() bool
Debug() bool
AConfig() Config
DeviceConfig() DeviceConfig
}
type BaseContext interface {
@@ -535,6 +536,10 @@ func (a *androidBaseContextImpl) AConfig() Config {
return a.config
}
func (a *androidBaseContextImpl) DeviceConfig() DeviceConfig {
return DeviceConfig{a.config.deviceConfig}
}
func (a *androidModuleContext) Proprietary() bool {
return a.module.base().commonProperties.Proprietary
}