Implement update_engine weave commands

The new WeaveServiceInterface abstracs the registration and interaction
with weave whenever present. The compilation and usage of weave is
based on the BRILLO_USE_WEAVE flag.

When enabled, update_engine registers the "_updater" component with
methods to force-check for an update and change channels.

Bug: 24386758
Bug: 24386768
Test: Deployed on edison, weave commands and state available online.

Change-Id: Ic49111772e123b8a2b1971da92fe65785f186ccd
diff --git a/update_engine.gyp b/update_engine.gyp
index 01d691d..5490a2a 100644
--- a/update_engine.gyp
+++ b/update_engine.gyp
@@ -27,6 +27,7 @@
       'USE_hwid_override%': '0',
       'USE_mtd%': '0',
       'USE_power_management%': '0',
+      'USE_buffet%': '0',
     },
     'cflags': [
       '-g',
@@ -50,6 +51,7 @@
       'USE_HWID_OVERRIDE=<(USE_hwid_override)',
       'USE_MTD=<(USE_mtd)',
       'USE_POWER_MANAGEMENT=<(USE_power_management)',
+      'USE_WEAVE=<(USE_buffet)',
     ],
     'include_dirs': [
       # We need this include dir because we include all the local code as
@@ -272,6 +274,19 @@
         'update_manager/state_factory.cc',
         'update_manager/update_manager.cc',
         'update_status_utils.cc',
+        'weave_service_factory.cc',
+      ],
+      'conditions': [
+        ['USE_buffet == 1', {
+          'sources': [
+            'weave_service.cc',
+          ],
+          'variables': {
+            'exported_deps': [
+              'libweave-<(libbase_ver)',
+            ],
+          },
+        }],
       ],
     },
     # update_engine daemon.