Add defaults modules for avb modules

Bug: 302465542
Test: build
Change-Id: I5bb5a0241d40cf142ed8bbefb76bc8a3709c3e34
This commit is contained in:
Inseob Kim
2023-11-22 18:55:07 +09:00
parent 4ce715f591
commit 87230e613d
3 changed files with 39 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ import (
type avbGenVbmetaImage struct {
android.ModuleBase
android.DefaultableModuleBase
properties avbGenVbmetaImageProperties
@@ -47,6 +48,7 @@ func avbGenVbmetaImageFactory() android.Module {
module := &avbGenVbmetaImage{}
module.AddProperties(&module.properties)
android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
android.InitDefaultableModule(module)
return module
}
@@ -106,3 +108,20 @@ func (a *avbGenVbmetaImage) OutputFiles(tag string) (android.Paths, error) {
}
return nil, fmt.Errorf("unsupported module reference tag %q", tag)
}
type avbGenVbmetaImageDefaults struct {
android.ModuleBase
android.DefaultsModuleBase
}
// avb_gen_vbmeta_image_defaults provides a set of properties that can be inherited by other
// avb_gen_vbmeta_image modules. A module can use the properties from an
// avb_gen_vbmeta_image_defaults using `defaults: ["<:default_module_name>"]`. Properties of both
// modules are erged (when possible) by prepending the default module's values to the depending
// module's values.
func avbGenVbmetaImageDefaultsFactory() android.Module {
module := &avbGenVbmetaImageDefaults{}
module.AddProperties(&avbGenVbmetaImageProperties{})
android.InitDefaultsModule(module)
return module
}