Fixing drivers & providers Buck app builds

Change-Id: I6a02a68568037eca0a0b82ad4f83ff18bfeada5f
diff --git a/drivers/arista/BUCK b/drivers/arista/BUCK
index 2de78bc..7f094d9 100644
--- a/drivers/arista/BUCK
+++ b/drivers/arista/BUCK
@@ -12,6 +12,11 @@
     '//core/api:onos-api-tests',
 ]
 
+BUNDLES = [
+    ':onos-drivers-arista',
+    '//drivers/utilities:onos-drivers-utilities',
+]
+
 osgi_jar_with_tests (
     deps = COMPILE_DEPS,
     test_deps = TEST_DEPS,
@@ -20,9 +25,11 @@
 )
 
 onos_app (
+    app_name = 'org.onosproject.drivers.arista',
     title = 'Arista Device Drivers',
     category = 'Drivers',
     url = 'http://onosproject.org',
     description = 'ONOS Arista Device Drivers application.',
+    included_bundles = BUNDLES,
     required_apps = [ 'org.onosproject.restsb' ],
-)
\ No newline at end of file
+)
diff --git a/drivers/bti/BUCK b/drivers/bti/BUCK
index b80854c..273e24f 100644
--- a/drivers/bti/BUCK
+++ b/drivers/bti/BUCK
@@ -21,6 +21,7 @@
 )
 
 onos_app (
+    app_name = 'org.onosproject.drivers.bti',
     title = 'Bti Device Drivers',
     category = 'Drivers',
     url = 'http://onosproject.org',
diff --git a/drivers/ciena/BUCK b/drivers/ciena/BUCK
index b340270..57e0ff6 100644
--- a/drivers/ciena/BUCK
+++ b/drivers/ciena/BUCK
@@ -11,6 +11,11 @@
     '//core/api:onos-api-tests',
 ]
 
+BUNDLES = [
+    ':onos-drivers-ciena',
+    '//drivers/utilities:onos-drivers-utilities',
+]
+
 osgi_jar_with_tests (
     deps = COMPILE_DEPS,
     test_deps = TEST_DEPS,
@@ -19,9 +24,11 @@
 )
 
 onos_app (
+    app_name = 'org.onosproject.drivers.ciena',
     title = 'Ciena Device Drivers',
     category = 'Drivers',
     url = 'http://onosproject.org',
     description = 'ONOS Ciena Device Drivers application.',
+    included_bundles = BUNDLES,
     required_apps = [ 'org.onosproject.restsb' ],
 )
diff --git a/drivers/cisco/BUCK b/drivers/cisco/BUCK
index c850e9d..6f73cd1 100644
--- a/drivers/cisco/BUCK
+++ b/drivers/cisco/BUCK
@@ -9,6 +9,11 @@
     '//core/api:onos-api-tests',
 ]
 
+BUNDLES = [
+    ':onos-drivers-cisco',
+    '//drivers/utilities:onos-drivers-utilities',
+]
+
 osgi_jar_with_tests (
     deps = COMPILE_DEPS,
     test_deps = TEST_DEPS,
@@ -17,9 +22,11 @@
 )
 
 onos_app (
+    app_name = 'org.onosproject.drivers.cisco',
     title = 'Cisco device drivers',
     category = 'Drivers',
     url = 'http://onosproject.org',
     description = 'ONOS Cisco device drivers application.',
-    required_apps = [ 'org.onosproject.netconf' ],
+    included_bundles = BUNDLES,
+    required_apps = [ 'org.onosproject.netconf', 'org.onosproject.drivers.netconf' ],
 )
diff --git a/drivers/fujitsu/BUCK b/drivers/fujitsu/BUCK
index 1020c17..4890811 100644
--- a/drivers/fujitsu/BUCK
+++ b/drivers/fujitsu/BUCK
@@ -11,6 +11,11 @@
     '//core/api:onos-api-tests',
 ]
 
+BUNDLES = [
+    ':onos-drivers-fujitsu',
+    '//drivers/utilities:onos-drivers-utilities',
+]
+
 osgi_jar_with_tests (
     deps = COMPILE_DEPS,
     test_deps = TEST_DEPS,
@@ -19,9 +24,11 @@
 )
 
 onos_app (
+    app_name = 'org.onosproject.drivers.fujitsu',
     title = 'Fujitsu device drivers',
     category = 'Drivers',
     url = 'http://onosproject.org',
     description = 'ONOS Fujitsu device drivers application.',
+    included_bundles = BUNDLES,
     required_apps = [ 'org.onosproject.netconf' ],
 )
diff --git a/drivers/fujitsu/src/main/java/org/onosproject/drivers/fujitsu/FujitsuDriversLoader.java b/drivers/fujitsu/src/main/java/org/onosproject/drivers/fujitsu/FujitsuDriversLoader.java
index b9b3789..b81d30a 100644
--- a/drivers/fujitsu/src/main/java/org/onosproject/drivers/fujitsu/FujitsuDriversLoader.java
+++ b/drivers/fujitsu/src/main/java/org/onosproject/drivers/fujitsu/FujitsuDriversLoader.java
@@ -17,6 +17,7 @@
 package org.onosproject.drivers.fujitsu;
 
 import org.apache.felix.scr.annotations.Component;
+import org.onosproject.cli.net.DeviceIdCompleter;
 import org.onosproject.net.driver.AbstractDriverLoader;
 import org.onosproject.net.optical.OpticalDevice;
 
@@ -29,6 +30,8 @@
     // OSGI: help bundle plugin discover runtime package dependency.
     @SuppressWarnings("unused")
     private OpticalDevice optical;
+    @SuppressWarnings("unused")
+    private DeviceIdCompleter deviceIdCompleter;
 
     public FujitsuDriversLoader() {
         super("/fujitsu-drivers.xml");
diff --git a/drivers/lumentum/BUCK b/drivers/lumentum/BUCK
index e2df8fa..0025279 100644
--- a/drivers/lumentum/BUCK
+++ b/drivers/lumentum/BUCK
@@ -19,6 +19,7 @@
 )
 
 onos_app (
+    app_name = 'org.onosproject.drivers.lumentum',
     title = 'Lumentum Device Drivers',
     category = 'Drivers',
     url = 'http://onosproject.org',
diff --git a/drivers/netconf/BUCK b/drivers/netconf/BUCK
index 2924b97..2824a07 100644
--- a/drivers/netconf/BUCK
+++ b/drivers/netconf/BUCK
@@ -9,6 +9,11 @@
     '//core/api:onos-api-tests',
 ]
 
+BUNDLES = [
+    ':onos-drivers-netconf',
+    '//drivers/utilities:onos-drivers-utilities',
+]
+
 osgi_jar_with_tests (
     deps = COMPILE_DEPS,
     test_deps = TEST_DEPS,
@@ -17,8 +22,11 @@
 )
 
 onos_app (
+    app_name = 'org.onosproject.drivers.netconf',
     title = 'NETCONF Device Drivers',
     category = 'Drivers',
     url = 'http://onosproject.org',
     description = 'ONOS NETCONF Device Drivers application.',
+    included_bundles = BUNDLES,
+    required_apps = [ 'org.onosproject.netconf' ],
 )
diff --git a/drivers/optical/BUCK b/drivers/optical/BUCK
index 98eb012..4519263 100644
--- a/drivers/optical/BUCK
+++ b/drivers/optical/BUCK
@@ -18,6 +18,7 @@
 )
 
 onos_app (
+    app_name = 'org.onosproject.drivers.optical',
     title = 'Other optical Device Drivers',
     category = 'Drivers',
     url = 'http://onosproject.org',
diff --git a/drivers/ovsdb/BUCK b/drivers/ovsdb/BUCK
index 336d4b0..6015611 100644
--- a/drivers/ovsdb/BUCK
+++ b/drivers/ovsdb/BUCK
@@ -23,4 +23,5 @@
     category = 'Drivers',
     url = 'http://onosproject.org',
     description = 'ONOS OVSDB Device Drivers application.',
+    required_apps = [ 'org.onosproject.ovsdb' ],
 )
diff --git a/modules.defs b/modules.defs
index 056d4e9..1e6b26a 100644
--- a/modules.defs
+++ b/modules.defs
@@ -46,16 +46,6 @@
     '//protocols/isis/isisio:onos-protocols-isis-isisio',
 
     '//drivers/utilities:onos-drivers-utilities',
-    '//drivers/bti:onos-drivers-bti-oar',
-    '//drivers/ciena:onos-drivers-ciena-oar',
-    '//drivers/cisco:onos-drivers-cisco-oar',
-    '//drivers/default:onos-drivers-default-oar',
-    '//drivers/fujitsu:onos-drivers-fujitsu-oar',
-    '//drivers/lumentum:onos-drivers-lumentum-oar',
-    '//drivers/netconf:onos-drivers-netconf-oar',
-    '//drivers/ovsdb:onos-drivers-ovsdb-oar',
-    '//drivers/optical:onos-drivers-optical-oar',
-    '//drivers/arista:onos-drivers-arista-oar',
 
     '//providers/netconf/device:onos-providers-netconf-device',
     '//providers/openflow/device:onos-providers-openflow-device',
@@ -77,7 +67,15 @@
 ONOS_DRIVERS = [
     # Drivers
     '//drivers/default:onos-drivers-default-oar',
+    '//drivers/arista:onos-drivers-arista-oar',
+    '//drivers/bti:onos-drivers-bti-oar',
+    '//drivers/ciena:onos-drivers-ciena-oar',
+    '//drivers/cisco:onos-drivers-cisco-oar',
     '//drivers/corsa:onos-drivers-corsa-oar',
+    '//drivers/fujitsu:onos-drivers-fujitsu-oar',
+    '//drivers/lumentum:onos-drivers-lumentum-oar',
+    '//drivers/netconf:onos-drivers-netconf-oar',
+    '//drivers/optical:onos-drivers-optical-oar',
     '//drivers/ovsdb:onos-drivers-ovsdb-oar',
 ]
 
diff --git a/providers/rest/BUCK b/providers/rest/BUCK
index 187f8ae..ff2baa8 100644
--- a/providers/rest/BUCK
+++ b/providers/rest/BUCK
@@ -9,7 +9,8 @@
 ]
 
 onos_app (
-    title = 'PCEP Provider',
+    app_name = 'org.onosproject.restsb',
+    title = 'REST Provider',
     category = 'Provider',
     url = 'http://onosproject.org',
     included_bundles = BUNDLES,
diff --git a/providers/snmp/BUCK b/providers/snmp/BUCK
index 3e2b1d1..7f00af1 100644
--- a/providers/snmp/BUCK
+++ b/providers/snmp/BUCK
@@ -2,9 +2,14 @@
   '//providers/snmp/device:onos-providers-snmp-device',
   '//protocols/snmp/api:onos-protocols-snmp-api',
   '//protocols/snmp/ctl:onos-protocols-snmp-ctl',
+  '//lib:org.apache.servicemix.bundles.snmp4j',
+  '//lib:snmp-core',
+  '//lib:bti7000',
+  '//lib:mibs-net-snmp',
 ]
 
 onos_app (
+    app_name = 'org.onosproject.snmp',
     title = 'SNMP Provider',
     category = 'Provider',
     url = 'http://onosproject.org',