I'm writing a wrapper over a Soong's module type, where I want to add some additional checks.
First, I have registered my custom module type :
func init() {
android.RegisterModuleType("my_cc_library_static", MyStaticLibrary)
}
Second, I've defined the function for this -
func MyStaticLibrary() android.Module {
m, library := cc.NewLibrary(android.HostAndDeviceSupported)
library.BuildOnlyStatic()
module := m.Init()
prop := module.GetProperties()
for _, properties := range prop {
propertiesValue := reflect.ValueOf(properties).Elem()
fmt.Printf("Prop Value Ele : %+v
", propertiesValue)
}
}
The output of this shows an empty structure. However, I expect this struct to be filled with the values provided in Android.bp of the component.
Chances are the module.GetPropeties() should not be called so early (in registration phase), but then I'm not exactly sure where else to call. Or do I need to add any Hooks ?
I want to read Cflags from Android.bp and based on it's value, need to append/remove some additional cflags.