buffet: Moved D-Bus definitions to XML/Code generator
Moved D-Bus interface definitions for buffet to XML files and using
the code generator to produce adaptors/proxies. Switched over the
implementations of objects to using the generated adaptors and using
the generated proxies in buffet_client.
Some more work on proxy generator is required to switch over the
usage of Command/CommandListener in libbuffet to using the generated
proxies, since the generator does not support D-Bus properties or
Object Manager yet.
BUG=chromium:435591
TEST=FEATURES=test emerge-link buffet
Change-Id: If010ee70b356d146e4a35a7301a753c9c54377f5
Reviewed-on: https://chromium-review.googlesource.com/231350
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/buffet/buffet.gyp b/buffet/buffet.gyp
index 12f4300..5072ba5 100644
--- a/buffet/buffet.gyp
+++ b/buffet/buffet.gyp
@@ -19,11 +19,32 @@
'libbuffet/dbus_constants.cc',
'libbuffet/private/command_property_set.cc',
],
+ 'actions': [
+ {
+ 'action_name': 'generate-buffet-proxies',
+ 'inputs': [
+ 'dbus_bindings/org.chromium.Buffet.Command.xml',
+ 'dbus_bindings/org.chromium.Buffet.Manager.xml',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/buffet/dbus-proxies.h',
+ ],
+ 'action': [
+ '<!(which generate-chromeos-dbus-bindings)',
+ '>@(_inputs)',
+ '--proxy=>(_outputs)'
+ ],
+ 'hard_dependency': 1,
+ },
+ ],
'includes': ['../common-mk/deps.gypi'],
},
{
'target_name': 'buffet_common',
'type': 'static_library',
+ 'variables': {
+ 'dbus_adaptors_out_dir': 'include/buffet',
+ },
'sources': [
'commands/command_definition.cc',
'commands/command_dictionary.cc',
@@ -40,6 +61,8 @@
'commands/schema_constants.cc',
'commands/schema_utils.cc',
'device_registration_info.cc',
+ 'dbus_bindings/org.chromium.Buffet.Command.xml',
+ 'dbus_bindings/org.chromium.Buffet.Manager.xml',
'manager.cc',
'storage_impls.cc',
'states/error_codes.cc',
@@ -48,6 +71,7 @@
'states/state_package.cc',
'utils.cc',
],
+ 'includes': ['../common-mk/generate-dbus-adaptors.gypi'],
},
{
'target_name': 'buffet',