Add modules to Bazel build
cli
core
incubator/rpc
pipelines/basic
protocols/netconf
protocols/openflow
protocols/rest

Change-Id: I165b94a04ba893d97d944e5deb2746f54566503b
diff --git a/BUILD b/BUILD
index 81cd843..2b0b646 100644
--- a/BUILD
+++ b/BUILD
@@ -1,22 +1,306 @@
+UTILS = [
+    "//utils/osgiwrap:osgi-jar",
+    "//utils/osgi:onlab-osgi",
+    "//utils/junit:onlab-junit",
+    "//utils/misc:onlab-misc",
+    "//utils/rest:onlab-rest",
+    #"//tools/build/conf:onos-build-conf",
+]
+
+API = [
+    "//core/api:onos-api",
+    "//incubator/api:onos-incubator-api",
+]
+
+CORE = UTILS + API + [
+    "//core/net:onos-core-net",
+    "//core/common:onos-core-common",
+    #"//core/store/primitives:onos-core-primitives",
+    "//core/store/serializers:onos-core-serializers",
+    "//core/store/dist:onos-core-dist",
+    "//core/security:onos-security",
+    "//core/store/persistence:onos-core-persistence",
+    "//incubator/net:onos-incubator-net",
+    "//incubator/store:onos-incubator-store",
+    "//incubator/rpc:onos-incubator-rpc",
+    "//cli:onos-cli",
+    "//protocols/rest/api:onos-protocols-rest-api",
+    "//protocols/rest/ctl:onos-protocols-rest-ctl",
+    #"//protocols/bgp/bgpio:onos-protocols-bgp-bgpio",
+    #"//protocols/bgp/api:onos-protocols-bgp-api",
+    #"//protocols/bgp/ctl:onos-protocols-bgp-ctl",
+    "//protocols/netconf/api:onos-protocols-netconf-api",
+    "//protocols/netconf/ctl:onos-protocols-netconf-ctl",
+    "//protocols/openflow/api:onos-protocols-openflow-api",
+    "//protocols/openflow/ctl:onos-protocols-openflow-ctl",
+    #"//protocols/ospf/api:onos-protocols-ospf-api",
+    #"//protocols/ospf/protocol:onos-protocols-ospf-protocol",
+    #"//protocols/ospf/ctl:onos-protocols-ospf-ctl",
+    #"//protocols/ovsdb/rfc:onos-protocols-ovsdb-rfc",
+    #"//protocols/ovsdb/api:onos-protocols-ovsdb-api",
+    #"//protocols/ovsdb/ctl:onos-protocols-ovsdb-ctl",
+    "//protocols/p4runtime/api:onos-protocols-p4runtime-api",
+    "//protocols/p4runtime/model:onos-protocols-p4runtime-model",
+    #"//protocols/pcep/pcepio:onos-protocols-pcep-pcepio",
+    #"//protocols/pcep/server/api:onos-protocols-pcep-server-api",
+    #"//protocols/pcep/server/ctl:onos-protocols-pcep-server-ctl",
+    #"//protocols/snmp/api:onos-protocols-snmp-api",
+    #"//protocols/snmp/ctl:onos-protocols-snmp-ctl",
+    #"//protocols/isis/api:onos-protocols-isis-api",
+    #"//protocols/isis/ctl:onos-protocols-isis-ctl",
+    #"//protocols/isis/isisio:onos-protocols-isis-isisio",
+    #"//protocols/lisp/api:onos-protocols-lisp-api",
+    #"//protocols/lisp/ctl:onos-protocols-lisp-ctl",
+    #"//protocols/lisp/msg:onos-protocols-lisp-msg",
+    #"//protocols/tl1/api:onos-protocols-tl1-api",
+    #"//protocols/tl1/ctl:onos-protocols-tl1-ctl",
+    #"//protocols/restconf/client/api:onos-protocols-restconf-client-api",
+    #"//protocols/restconf/client/ctl:onos-protocols-restconf-client-ctl",
+    #"//protocols/xmpp/core/api:onos-protocols-xmpp-core-api",
+    #"//protocols/xmpp/core/ctl:onos-protocols-xmpp-core-ctl",
+    #"//drivers/utilities:onos-drivers-utilities",
+    #"//providers/netconf/device:onos-providers-netconf-device",
+    #"//providers/openflow/device:onos-providers-openflow-device",
+    #"//providers/openflow/packet:onos-providers-openflow-packet",
+    #"//providers/openflow/flow:onos-providers-openflow-flow",
+    #"//providers/openflow/group:onos-providers-openflow-group",
+    #"//providers/openflow/meter:onos-providers-openflow-meter",
+    #"//providers/ovsdb/device:onos-providers-ovsdb-device",
+    #"//providers/ovsdb/tunnel:onos-providers-ovsdb-tunnel",
+    #"//providers/rest/device:onos-providers-rest-device",
+    #"//providers/snmp/device:onos-providers-snmp-device",
+    #"//providers/isis/cfg:onos-providers-isis-cfg",
+    #"//providers/isis/topology:onos-providers-isis-topology",
+    #"//providers/lisp/device:onos-providers-lisp-device",
+    #"//providers/tl1/device:onos-providers-tl1-device",
+    #"//providers/general/device:onos-providers-general-device",
+    #"//providers/p4runtime/packet:onos-providers-p4runtime-packet",
+    #"//web/api:onos-rest",
+    #"//web/gui2:onos-gui2",
+    #"//web/gui:onos-gui",
+    #"//incubator/protobuf/models:onos-incubator-protobuf-models",
+    #"//incubator/protobuf/services/nb:onos-incubator-protobuf-services-nb",
+]
+
+ONOS_DRIVERS = [
+    # Drivers
+    "//drivers/default:onos-drivers-default",
+    #"//drivers/arista:onos-drivers-arista-oar",
+    #"//drivers/ciena/waveserver:onos-drivers-ciena-waveserver-oar",
+    #"//drivers/ciena/c5162:onos-drivers-ciena-c5162-oar",
+    #"//drivers/ciena/c5170:onos-drivers-ciena-c5170-oar",
+    #"//drivers/ciena/waveserverai:onos-drivers-ciena-waveserverai-oar",
+    #"//drivers/cisco/netconf:onos-drivers-cisco-netconf-oar",
+    #"//drivers/cisco/rest:onos-drivers-cisco-rest-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/server:onos-drivers-server-oar",
+    #"//drivers/optical:onos-drivers-optical-oar",
+    #"//drivers/ovsdb:onos-drivers-ovsdb-oar",
+    #"//drivers/juniper:onos-drivers-juniper-oar",
+    #"//drivers/lisp:onos-drivers-lisp-oar",
+    #"//drivers/flowspec:onos-drivers-flowspec-oar",
+    #"//drivers/huawei:onos-drivers-huawei-oar",
+    #"//drivers/microsemi/ea1000:onos-drivers-microsemi-ea1000-oar",
+    #"//drivers/oplink:onos-drivers-oplink-oar",
+    #"//drivers/bmv2:onos-drivers-bmv2-oar",
+    #"//drivers/barefoot:onos-drivers-barefoot-oar",
+    #"//drivers/mellanox:onos-drivers-mellanox-oar",
+    #"//drivers/hp:onos-drivers-hp-oar",
+    #"//drivers/p4runtime:onos-drivers-p4runtime-oar",
+    #"//drivers/gnmi:onos-drivers-gnmi-oar",
+    #"//drivers/polatis/netconf:onos-drivers-polatis-netconf-oar",
+    #"//drivers/polatis/openflow:onos-drivers-polatis-openflow-oar",
+    #"//drivers/odtn-driver:onos-drivers-odtn-driver-oar",
+]
+
+ONOS_PROVIDERS = [
+    # Providers
+    #"//providers/bgp:onos-providers-bgp-oar",
+    #"//providers/bgpcep:onos-providers-bgpcep-oar",
+    #"//providers/host:onos-providers-host-oar",
+    #"//providers/lldp:onos-providers-lldp-oar",
+    #"//providers/netcfghost:onos-providers-netcfghost-oar",
+    #"//providers/netcfglinks:onos-providers-netcfglinks-oar",
+    #"//providers/netconf:onos-providers-netconf-oar",
+    #"//providers/openflow/message:onos-providers-openflow-message-oar",
+    #"//providers/ovsdb:onos-providers-ovsdb-oar",
+    #"//providers/ovsdb/host:onos-providers-ovsdb-host-oar",
+    #"//providers/ovsdb/base:onos-providers-ovsdb-base-oar",
+    #"//providers/pcep:onos-providers-pcep-oar",
+    #"//providers/null:onos-providers-null-oar",
+    #"//providers/openflow/base:onos-providers-openflow-base-oar",
+    #"//providers/openflow/app:onos-providers-openflow-app-oar",
+    #"//providers/rest:onos-providers-rest-oar",
+    #"//providers/isis:onos-providers-isis-oar",
+    #"//providers/snmp:onos-providers-snmp-oar",
+    #"//providers/link:onos-providers-link-oar",
+    #"//providers/lisp:onos-providers-lisp-oar",
+    #"//providers/tl1:onos-providers-tl1-oar",
+    #"//providers/general:onos-providers-general-oar",
+    #"//providers/p4runtime:onos-providers-p4runtime-oar",
+    #    '//providers/ietfte:onos-providers-ietfte-oar',
+    #"//providers/xmpp/device:onos-providers-xmpp-device-oar",
+]
+
+ONOS_APPS = [
+    # Apps
+    #"//apps/dhcp:onos-apps-dhcp-oar",
+    #"//apps/dhcprelay:onos-apps-dhcprelay-oar",
+    #"//apps/fwd:onos-apps-fwd-oar",
+    #"//apps/packet-stats:onos-apps-packet-stats-oar",
+    #"//apps/acl:onos-apps-acl-oar",
+    #"//apps/bgprouter:onos-apps-bgprouter-oar",
+    #"//apps/cip:onos-apps-cip-oar",
+    #"//apps/drivermatrix:onos-apps-drivermatrix-oar",
+    #"//apps/events:onos-apps-events-oar",
+    #"//apps/proxyarp:onos-apps-proxyarp-oar",
+    #"//apps/segmentrouting:onos-apps-segmentrouting-oar",
+    #"//apps/gangliametrics:onos-apps-gangliametrics-oar",
+    #"//apps/graphitemetrics:onos-apps-graphitemetrics-oar",
+    #"//apps/flowanalyzer:onos-apps-flowanalyzer-oar",
+    #"//apps/intentsync:onos-apps-intentsync-oar",
+    #"//apps/influxdbmetrics:onos-apps-influxdbmetrics-oar",
+    #"//apps/metrics:onos-apps-metrics-oar",
+    #"//apps/mfwd:onos-apps-mfwd-oar",
+    #"//apps/mlb:onos-apps-mlb-oar",
+    #"//apps/openstacknetworking:onos-apps-openstacknetworking-oar",
+    #"//apps/mobility:onos-apps-mobility-oar",
+    #"//apps/newoptical:onos-apps-newoptical-oar",
+    #"//apps/optical-model:onos-apps-optical-model-oar",
+    #"//apps/optical-rest:onos-apps-optical-rest-oar",
+    #"//apps/pathpainter:onos-apps-pathpainter-oar",
+    #"//apps/pcep-api:onos-apps-pcep-api-oar",
+    #"//apps/pim:onos-apps-pim-oar",
+    #"//apps/linkprops:onos-apps-linkprops-oar",
+    #"//apps/reactive-routing:onos-apps-reactive-routing-oar",
+    #"//apps/roadm:onos-apps-roadm-oar",
+    #"//apps/sdnip:onos-apps-sdnip-oar",
+    #"//apps/test/cluster-ha:onos-apps-test-cluster-ha-oar",
+    #"//apps/test/demo:onos-apps-test-demo-oar",
+    #"//apps/test/distributed-primitives:onos-apps-test-distributed-primitives-oar",
+    #"//apps/test/election:onos-apps-test-election-oar",
+    #"//apps/test/flow-perf:onos-apps-test-flow-perf-oar",
+    #"//apps/test/intent-perf:onos-apps-test-intent-perf-oar",
+    #"//apps/test/route-scale:onos-apps-test-route-scale-oar",
+    #"//apps/test/loadtest:onos-apps-test-loadtest-oar",
+    #"//apps/test/netcfg-monitor:onos-apps-test-netcfg-monitor-oar",
+    #"//apps/test/messaging-perf:onos-apps-test-messaging-perf-oar",
+    #"//apps/test/primitive-perf:onos-apps-test-primitive-perf-oar",
+    #"//apps/test/transaction-perf:onos-apps-test-transaction-perf-oar",
+    #"//apps/virtualbng:onos-apps-virtualbng-oar",
+    #"//apps/vpls:onos-apps-vpls-oar",
+    #"//apps/vrouter:onos-apps-vrouter-oar",
+    #"//apps/routing/fibinstaller:onos-apps-routing-fibinstaller-oar",
+    #"//apps/routing/cpr:onos-apps-routing-cpr-oar",
+    #"//apps/routing/fpm:onos-apps-routing-fpm-oar",
+    #"//apps/vtn:onos-apps-vtn-oar",
+    #"//apps/faultmanagement:onos-apps-faultmanagement-oar",
+    #"//apps/openstacknode:onos-apps-openstacknode-oar",
+    #"//apps/cpman/app:onos-apps-cpman-app-oar",
+    #"//apps/scalablegateway:onos-apps-scalablegateway-oar",
+    #"//apps/castor:onos-apps-castor-oar",
+    #    '//apps/yms:onos-apps-yms-oar',
+    #"//apps/ofagent:onos-apps-ofagent-oar",
+    #"//apps/mappingmanagement:onos-apps-mappingmanagement-oar",
+    #"//apps/config:onos-apps-config-oar",
+    #"//apps/configsync:onos-apps-configsync-oar",
+    #"//apps/configsync-netconf:onos-apps-configsync-netconf-oar",
+    #"//apps/netconf/client:onos-apps-netconf-client-oar",
+    #"//apps/tetopology:onos-apps-tetopology-oar",
+    #"//apps/tetunnel:onos-apps-tetunnel-oar",
+    #    '//apps/tenbi/yangmodel:onos-apps-tenbi-yangmodel-feature',
+    #    '//apps/tenbi:onos-apps-tenbi-oar',
+    #"//protocols/restconf/server:onos-protocols-restconf-server-oar",
+    #"//apps/restconf:onos-apps-restconf-oar",
+    #"//apps/flowspec-api:onos-apps-flowspec-api-oar",
+    #"//apps/yang:onos-apps-yang-oar",
+    #"//apps/yang-gui:onos-apps-yang-gui-oar",
+    #"//apps/cord-support:onos-apps-cord-support-oar",
+    #"//apps/network-troubleshoot:onos-apps-network-troubleshoot-oar",
+    #"//apps/l3vpn:onos-apps-l3vpn-oar",
+    #"//apps/openroadm:onos-apps-openroadm-oar",
+    #"//apps/artemis:onos-apps-artemis-oar",
+    #"//apps/pi-demo/ecmp:onos-apps-pi-demo-ecmp-oar",
+    #"//apps/gluon:onos-apps-gluon-oar",
+    #"//apps/evpnopenflow:onos-apps-evpnopenflow-oar",
+    #"//apps/route-service:onos-apps-route-service-oar",
+    #"//apps/evpn-route-service:onos-apps-evpn-route-service-oar",
+    #"//incubator/protobuf/registry:onos-incubator-protobuf-registry-oar",
+    #"//incubator/protobuf/services/nb:onos-incubator-protobuf-services-nb-oar",
+    #"//apps/openstacknetworkingui:onos-apps-openstacknetworkingui-oar",
+    #"//apps/openstacktelemetry:onos-apps-openstacktelemetry-oar",
+    #"//apps/p4-tutorial/pipeconf:onos-apps-p4-tutorial-pipeconf-oar",
+    #"//apps/p4-tutorial/mytunnel:onos-apps-p4-tutorial-mytunnel-oar",
+    #"//apps/cfm:onos-apps-cfm-oar",
+    #"//apps/routeradvertisement:onos-apps-routeradvertisement-oar",
+    #"//apps/powermanagement:onos-apps-powermanagement-oar",
+    #"//apps/t3:onos-apps-t3-oar",
+    #"//apps/simplefabric:onos-apps-simplefabric-oar",
+    #"//apps/kafka-integration:onos-apps-kafka-integration-oar",
+    #"//apps/rabbitmq:onos-apps-rabbitmq-oar",
+    #"//apps/odtn/api:onos-apps-odtn-api-oar",
+    #"//apps/odtn/service:onos-apps-odtn-service-oar",
+    #"//apps/mcast:onos-apps-mcast-oar",
+    #"//apps/layout:onos-apps-layout-oar",
+    #"//apps/imr:onos-apps-imr-oar",
+    #"//apps/nodemetrics:onos-apps-nodemetrics-oar",
+    #"//web/gui2:onos-web-gui2-oar",
+]
+
+PROTOCOL_APPS = [
+    #"//protocols/grpc:onos-protocols-grpc-oar",
+    #"//protocols/p4runtime:onos-protocols-p4runtime-oar",
+    #"//protocols/gnmi:onos-protocols-gnmi-oar",
+    #"//protocols/xmpp/core:onos-protocols-xmpp-core-oar",
+    #"//protocols/xmpp/pubsub:onos-protocols-xmpp-pubsub-oar",
+]
+
+MODELS = [
+    #"//models/ietf:onos-models-ietf-oar",
+    #"//models/common:onos-models-common-oar",
+    #"//models/huawei:onos-models-huawei-oar",
+    #"//models/openconfig:onos-models-openconfig-oar",
+    #"//models/openconfig-infinera:onos-models-openconfig-infinera-oar",
+    #"//models/openroadm:onos-models-openroadm-oar",
+    #"//models/tapi:onos-models-tapi-oar",
+    #"//models/l3vpn:onos-models-l3vpn-oar",
+    #"//models/microsemi:onos-models-microsemi-oar",
+    #"//models/polatis:onos-models-polatis-oar",
+    #"//models/ciena/waveserverai:onos-models-ciena-waveserverai-oar",
+]
+
+PIPELINES = [
+    #"//pipelines/basic:onos-pipelines-basic-oar",
+    #"//pipelines/fabric:onos-pipelines-fabric-oar",
+]
+
+APP_JARS = [
+    #"//apps/cpman/api:onos-apps-cpman-api",
+    #"//apps/routing-api:onos-apps-routing-api",
+    #"//apps/dhcp/api:onos-apps-dhcp-api",
+    #"//apps/dhcp/app:onos-apps-dhcp-app",
+    #"//apps/imr/api:onos-apps-imr-api",
+    #"//apps/imr/app:onos-apps-imr-app",
+    #"//apps/dhcprelay:onos-apps-dhcprelay",
+    #"//apps/fwd:onos-apps-fwd",
+    #"//apps/iptopology-api:onos-apps-iptopology-api",
+    #"//apps/routing/common:onos-apps-routing-common",
+    #"//apps/vtn/vtnrsc:onos-apps-vtn-vtnrsc",
+    #"//apps/vtn/sfcmgr:onos-apps-vtn-sfcmgr",
+    #"//apps/vtn/vtnmgr:onos-apps-vtn-vtnmgr",
+    #"//apps/vtn/vtnweb:onos-apps-vtn-vtnweb",
+    #   '//apps/p4runtime-test:onos-apps-p4runtime-test',
+    #"//apps/kafka-integration/api:onos-apps-kafka-integration-api",
+    #"//apps/kafka-integration/app:onos-apps-kafka-integration-app",
+]
+
+APPS = ONOS_DRIVERS + ONOS_PROVIDERS + ONOS_APPS + MODELS + PIPELINES + \
+       PROTOCOL_APPS
+
 filegroup(
     name = "onos",
-    srcs = [
-        "//utils/junit:onlab-junit-osgi",
-        "//utils/misc:onlab-misc-osgi",
-        "//utils/osgi:onlab-osgi-osgi",
-        "//utils/rest:onlab-rest-osgi",
-        "//utils/osgiwrap:osgi-jar",
-        "//core/api:onos-api-osgi",
-        "//core/common:onos-core-common-osgi",
-        "//incubator/api:onos-incubator-api-osgi",
-        "//core/store/serializers:onos-core-serializers-osgi",
-        "//core/store/dist:onos-core-dist-osgi",
-        "//incubator/store:onos-incubator-store",
-        "//incubator/net:onos-incubator-net",
-        "//protocols/openflow/api:onos-protocols-openflow-api-osgi",
-        "//drivers/default:onos-drivers-default-osgi",
-        "//protocols/p4runtime/api:onos-protocols-p4runtime-api-osgi",
-        "//protocols/p4runtime/model:onos-protocols-p4runtime-model-osgi",
-        #"//core/net:onos-core-net-osgi",
-    ],
+    srcs = CORE + APPS,
 )
diff --git a/cli/BUILD b/cli/BUILD
new file mode 100644
index 0000000..b8a3f5b
--- /dev/null
+++ b/cli/BUILD
@@ -0,0 +1,12 @@
+COMPILE_DEPS = CORE_DEPS + JACKSON + METRICS + [
+    "@org_apache_karaf_shell_console//jar",
+    "//incubator/api:onos-incubator-api",
+    "//incubator/net:onos-incubator-net",
+    "//utils/rest:onlab-rest",
+    "//core/common:onos-core-common",
+]
+
+osgi_jar(
+    visibility = ["//visibility:public"],
+    deps = COMPILE_DEPS,
+)
diff --git a/core/net/BUILD b/core/net/BUILD
new file mode 100644
index 0000000..91ee022
--- /dev/null
+++ b/core/net/BUILD
@@ -0,0 +1,27 @@
+COMPILE_DEPS = CORE_DEPS + JACKSON + METRICS + KRYO + [
+    "//core/common:onos-core-common",
+    "//incubator/api:onos-incubator-api",
+    "//utils/rest:onlab-rest",
+    "//incubator/net:onos-incubator-net",
+    "//incubator/store:onos-incubator-store",
+    "//core/store/serializers:onos-core-serializers",
+]
+
+TEST_DEPS = TEST + TEST_REST + TEST_ADAPTERS + [
+    "//core/store/dist:onos-core-dist",
+    "//core/store/dist:onos-core-dist-tests",
+    "//utils/osgi:onlab-osgi-tests",
+    "//pipelines/basic:onos-pipelines-basic",
+    "@minimal_json//jar",
+]
+
+osgi_jar_with_tests(
+    name = "onos-core-net",
+    exclude_tests = [
+        "org.onosproject.net.intent.impl.compiler.AbstractLinkCollectionTest",
+        "org.onosproject.net.intent.impl.installer.AbstractIntentInstallerTest",
+    ],
+    test_deps = TEST_DEPS,
+    visibility = ["//visibility:public"],
+    deps = COMPILE_DEPS,
+)
diff --git a/core/security/BUILD b/core/security/BUILD
new file mode 100644
index 0000000..3bc076a
--- /dev/null
+++ b/core/security/BUILD
@@ -0,0 +1,11 @@
+COMPILE_DEPS = CORE_DEPS + KRYO + [
+    "@org_apache_felix_framework_security//jar",
+    "//core/store/serializers:onos-core-serializers",
+]
+
+osgi_jar_with_tests(
+    name = "onos-security",
+    test_deps = TEST,
+    visibility = ["//visibility:public"],
+    deps = COMPILE_DEPS,
+)
diff --git a/core/store/persistence/BUILD b/core/store/persistence/BUILD
new file mode 100644
index 0000000..f8d7144
--- /dev/null
+++ b/core/store/persistence/BUILD
@@ -0,0 +1,12 @@
+COMPILE_DEPS = CORE_DEPS + [
+    "@mapdb//jar",
+]
+
+osgi_jar_with_tests(
+    name = "onos-core-persistence",
+    exclude_tests = [
+        "org.onosproject.persistence.impl.MapDBTest",
+    ],
+    visibility = ["//visibility:public"],
+    deps = COMPILE_DEPS,
+)
diff --git a/incubator/rpc/BUILD b/incubator/rpc/BUILD
new file mode 100644
index 0000000..98bf337
--- /dev/null
+++ b/incubator/rpc/BUILD
@@ -0,0 +1,8 @@
+COMPILE_DEPS = CORE_DEPS + [
+    "//incubator/api:onos-incubator-api",
+]
+
+osgi_jar_with_tests(
+    visibility = ["//visibility:public"],
+    deps = COMPILE_DEPS,
+)
diff --git a/pipelines/basic/BUILD b/pipelines/basic/BUILD
new file mode 100644
index 0000000..79e660d
--- /dev/null
+++ b/pipelines/basic/BUILD
@@ -0,0 +1,27 @@
+COMPILE_DEPS = CORE_DEPS + [
+    "@minimal_json//jar",
+    "//drivers/default:onos-drivers-default",
+    "//protocols/p4runtime/model:onos-protocols-p4runtime-model",
+    "//protocols/p4runtime/api:onos-protocols-p4runtime-api",
+]
+
+BUNDLES = [
+    "//pipelines/basic:onos-pipelines-basic",
+]
+
+osgi_jar(
+    deps = COMPILE_DEPS,
+)
+
+#onos_app(
+#    app_name = 'org.onosproject.pipelines.basic',
+#    title = 'Basic Pipelines',
+#    category = 'Pipeline',
+#    url = 'http://onosproject.org',
+#    description = 'Provides pipelines with basic L2/L3 forwarding capabilities and packet-in/out '
+#                  + 'support.',
+#    included_bundles = BUNDLES,
+#    required_apps = [
+#        'org.onosproject.drivers.p4runtime',
+#    ]
+#)
diff --git a/protocols/netconf/api/BUILD b/protocols/netconf/api/BUILD
new file mode 100644
index 0000000..2d486c5
--- /dev/null
+++ b/protocols/netconf/api/BUILD
@@ -0,0 +1,3 @@
+osgi_jar_with_tests(
+    deps = CORE_DEPS + JACKSON,
+)
diff --git a/protocols/netconf/ctl/BUILD b/protocols/netconf/ctl/BUILD
new file mode 100644
index 0000000..09346b2
--- /dev/null
+++ b/protocols/netconf/ctl/BUILD
@@ -0,0 +1,19 @@
+COMPILE_DEPS = CORE_DEPS + JACKSON + [
+    "@ganymed_ssh2//jar",
+    "@org_apache_karaf_shell_console//jar",
+    "@sshd_core//jar",
+    "@bcpkix_jdk15on//jar",
+    "@bcprov_jdk15on//jar",
+    "//protocols/netconf/api:onos-protocols-netconf-api",
+    "//cli:onos-cli",
+]
+
+TEST_DEPS = TEST_ADAPTERS + [
+    "//utils/osgi:onlab-osgi-tests",
+    "//core/api:onos-api-tests",
+]
+
+osgi_jar_with_tests(
+    test_deps = TEST_DEPS,
+    deps = COMPILE_DEPS,
+)
diff --git a/protocols/openflow/ctl/BUILD b/protocols/openflow/ctl/BUILD
new file mode 100644
index 0000000..3bf8b7f
--- /dev/null
+++ b/protocols/openflow/ctl/BUILD
@@ -0,0 +1,17 @@
+COMPILE_DEPS = CORE_DEPS + NETTY + JACKSON + [
+    "@openflowj//jar",
+    "@netty_codec//jar",
+    "@netty_handler//jar",
+    "@netty_transport//jar",
+    "@netty_transport_native_epoll//jar",
+    "//protocols/openflow/api:onos-protocols-openflow-api",
+]
+
+TEST_DEPS = TEST + [
+    "//core/api:onos-api-tests",
+]
+
+osgi_jar_with_tests(
+    test_deps = TEST_DEPS,
+    deps = COMPILE_DEPS,
+)
diff --git a/protocols/p4runtime/api/BUILD b/protocols/p4runtime/api/BUILD
index 4b86e7f..de7b487 100644
--- a/protocols/p4runtime/api/BUILD
+++ b/protocols/p4runtime/api/BUILD
@@ -8,7 +8,7 @@
     "//core/api:onos-api-tests",
 ]
 
-osgi_jar_with_tests (
-    deps = COMPILE_DEPS,
+osgi_jar_with_tests(
     test_deps = TEST_DEPS,
+    deps = COMPILE_DEPS,
 )
diff --git a/protocols/p4runtime/model/BUILD b/protocols/p4runtime/model/BUILD
index 5fa75cd..3ac33b6 100644
--- a/protocols/p4runtime/model/BUILD
+++ b/protocols/p4runtime/model/BUILD
@@ -6,6 +6,6 @@
     "@com_google_protobuf//:protobuf_java",
 ]
 
-osgi_jar_with_tests (
+osgi_jar_with_tests(
     deps = COMPILE_DEPS,
 )
diff --git a/protocols/p4runtime/proto/BUILD b/protocols/p4runtime/proto/BUILD
index 2a6d5f5..51da262 100644
--- a/protocols/p4runtime/proto/BUILD
+++ b/protocols/p4runtime/proto/BUILD
@@ -1,24 +1,23 @@
 java_proto_library(
     name = "p4_types_java_proto",
-    deps = [ "@p4lang_pi//:p4types_proto" ],
     visibility = ["//visibility:public"],
+    deps = ["@p4lang_pi//:p4types_proto"],
 )
 
 java_proto_library(
     name = "p4_config_java_proto",
-    deps = [ "@p4lang_pi//:p4config_proto" ],
     visibility = ["//visibility:public"],
+    deps = ["@p4lang_pi//:p4config_proto"],
 )
 
 java_proto_library(
     name = "p4_tmp_config_java_proto",
-    deps = [ "@p4lang_pi//:p4_tmp_config_proto" ],
     visibility = ["//visibility:public"],
+    deps = ["@p4lang_pi//:p4_tmp_config_proto"],
 )
 
 java_proto_library(
     name = "p4_runtime_java_proto",
-    deps = [ "@p4lang_pi//:p4_runtime_proto" ],
     visibility = ["//visibility:public"],
+    deps = ["@p4lang_pi//:p4_runtime_proto"],
 )
-
diff --git a/protocols/rest/api/BUILD b/protocols/rest/api/BUILD
new file mode 100644
index 0000000..feaa98f
--- /dev/null
+++ b/protocols/rest/api/BUILD
@@ -0,0 +1,19 @@
+COMPILE_DEPS = CORE_DEPS + [
+    "@jersey_client//jar",
+    "@jersey_server//jar",
+    "@jersey_common//jar",
+    "@jersey_security//jar",
+    "@httpclient_osgi//jar",
+    "@httpcore_osgi//jar",
+    "@javax_ws_rs_api//jar",
+    "@hk2_api//jar",
+    "@aopalliance_repackaged//jar",
+    "@javax_inject//jar",
+    "//incubator/api:onos-incubator-api",
+    "//utils/rest:onlab-rest",
+]
+
+osgi_jar_with_tests(
+    visibility = ["//visibility:public"],
+    deps = COMPILE_DEPS,
+)
diff --git a/protocols/rest/ctl/BUILD b/protocols/rest/ctl/BUILD
new file mode 100644
index 0000000..f2b3d0c
--- /dev/null
+++ b/protocols/rest/ctl/BUILD
@@ -0,0 +1,17 @@
+COMPILE_DEPS = CORE_DEPS + [
+    "@jersey_client//jar",
+    "@jersey_server//jar",
+    "@jersey_common//jar",
+    "@jersey_security//jar",
+    "@httpclient_osgi//jar",
+    "@httpcore_osgi//jar",
+    "@javax_ws_rs_api//jar",
+    "@hk2_api//jar",
+    "@aopalliance_repackaged//jar",
+    "@javax_inject//jar",
+    "//protocols/rest/api:onos-protocols-rest-api",
+]
+
+osgi_jar_with_tests(
+    deps = COMPILE_DEPS,
+)
diff --git a/tools/build/bazel/p4lang_workspace.bzl b/tools/build/bazel/p4lang_workspace.bzl
index 03b4e40..860f621 100644
--- a/tools/build/bazel/p4lang_workspace.bzl
+++ b/tools/build/bazel/p4lang_workspace.bzl
@@ -4,8 +4,8 @@
 PI_COMMIT = "219b3d67299ec09b49f433d7341049256ab5f512"
 PI_REPO = "p4lang/PI"
 
-GOOGLE_RPC_COMMIT_SHORT = "932f273"
-GOOGLE_RPC_COMMIT = "master"
+GOOGLE_RPC_COMMIT_SHORT = "916e66d"
+GOOGLE_RPC_COMMIT = "916e66d03a4f4716937b3bfa6539b9de8a598b7c"
 GOOGLE_RPC_REPO = "googleapis/googleapis"
 
 def _format_github_url(repo, commit):
diff --git a/tools/build/bazel/variables.bzl b/tools/build/bazel/variables.bzl
index cad0944..74b526e 100644
--- a/tools/build/bazel/variables.bzl
+++ b/tools/build/bazel/variables.bzl
@@ -1 +1 @@
-ONOS_VERSION = "1.13.0-SNAPSHOT"
+ONOS_VERSION = "1.14.0-SNAPSHOT"
diff --git a/utils/osgi/src/main/java/org/onlab/osgi/DefaultServiceDirectory.java b/utils/osgi/src/main/java/org/onlab/osgi/DefaultServiceDirectory.java
index 36883fe..40894e3 100644
--- a/utils/osgi/src/main/java/org/onlab/osgi/DefaultServiceDirectory.java
+++ b/utils/osgi/src/main/java/org/onlab/osgi/DefaultServiceDirectory.java
@@ -15,6 +15,7 @@
  */
 package org.onlab.osgi;
 
+import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.ServiceReference;
@@ -32,13 +33,16 @@
      * @return service implementation
      */
     public static <T> T getService(Class<T> serviceClass) {
-        BundleContext bc = FrameworkUtil.getBundle(serviceClass).getBundleContext();
-        if (bc != null) {
-            ServiceReference<T> reference = bc.getServiceReference(serviceClass);
-            if (reference != null) {
-                T impl = bc.getService(reference);
-                if (impl != null) {
-                    return impl;
+        Bundle bundle = FrameworkUtil.getBundle(serviceClass);
+        if (bundle != null) {
+            BundleContext bc = bundle.getBundleContext();
+            if (bc != null) {
+                ServiceReference<T> reference = bc.getServiceReference(serviceClass);
+                if (reference != null) {
+                    T impl = bc.getService(reference);
+                    if (impl != null) {
+                        return impl;
+                    }
                 }
             }
         }