Merge "Add prebuilt_defaults for prebuilt etc modules" am: d91c75ca09
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1698425 Change-Id: Icf6552fe42f1427feabab0562c530fe64a7756ae
This commit is contained in:
commit
837b94419f
|
@ -55,6 +55,8 @@ func RegisterPrebuiltEtcBuildComponents(ctx android.RegistrationContext) {
|
|||
ctx.RegisterModuleType("prebuilt_firmware", PrebuiltFirmwareFactory)
|
||||
ctx.RegisterModuleType("prebuilt_dsp", PrebuiltDSPFactory)
|
||||
ctx.RegisterModuleType("prebuilt_rfsa", PrebuiltRFSAFactory)
|
||||
|
||||
ctx.RegisterModuleType("prebuilt_defaults", defaultsFactory)
|
||||
}
|
||||
|
||||
var PrepareForTestWithPrebuiltEtc = android.FixtureRegisterWithContext(RegisterPrebuiltEtcBuildComponents)
|
||||
|
@ -124,6 +126,7 @@ type PrebuiltEtcModule interface {
|
|||
|
||||
type PrebuiltEtc struct {
|
||||
android.ModuleBase
|
||||
android.DefaultableModuleBase
|
||||
|
||||
properties prebuiltEtcProperties
|
||||
subdirProperties prebuiltSubdirProperties
|
||||
|
@ -139,6 +142,11 @@ type PrebuiltEtc struct {
|
|||
additionalDependencies *android.Paths
|
||||
}
|
||||
|
||||
type Defaults struct {
|
||||
android.ModuleBase
|
||||
android.DefaultsModuleBase
|
||||
}
|
||||
|
||||
func (p *PrebuiltEtc) inRamdisk() bool {
|
||||
return p.ModuleBase.InRamdisk() || p.ModuleBase.InstallInRamdisk()
|
||||
}
|
||||
|
@ -378,6 +386,25 @@ func PrebuiltEtcFactory() android.Module {
|
|||
InitPrebuiltEtcModule(module, "etc")
|
||||
// This module is device-only
|
||||
android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
|
||||
android.InitDefaultableModule(module)
|
||||
return module
|
||||
}
|
||||
|
||||
func defaultsFactory() android.Module {
|
||||
return DefaultsFactory()
|
||||
}
|
||||
|
||||
func DefaultsFactory(props ...interface{}) android.Module {
|
||||
module := &Defaults{}
|
||||
|
||||
module.AddProperties(props...)
|
||||
module.AddProperties(
|
||||
&prebuiltEtcProperties{},
|
||||
&prebuiltSubdirProperties{},
|
||||
)
|
||||
|
||||
android.InitDefaultsModule(module)
|
||||
|
||||
return module
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue