Bazel build files for protocols

Change-Id: I12a9cfe2d135d10c640a51d9b3438bcd92f8e37f
diff --git a/protocols/xmpp/core/BUILD b/protocols/xmpp/core/BUILD
new file mode 100644
index 0000000..c3834c8
--- /dev/null
+++ b/protocols/xmpp/core/BUILD
@@ -0,0 +1,23 @@
+BUNDLES = [
+    "@tinder_xmpp//jar",
+    "@org_apache_servicemix_bundles_dom4j//jar",
+    "@netty_common//jar",
+    "@netty_transport//jar",
+    "@netty_buffer//jar",
+    "@netty_codec//jar",
+    "@stax2_api//jar",
+    "@aalto_xml//jar",
+    "@concurrent_hashmap//jar",
+    "@gnu_idn//jar",
+    "//protocols/xmpp/core/api:onos-protocols-xmpp-core-api",
+    "//protocols/xmpp/core/ctl:onos-protocols-xmpp-core-ctl",
+]
+
+onos_app(
+    app_name = "org.onosproject.protocols.xmpp",
+    category = "Protocol",
+    description = "ONOS XMPP core protocol subsystem",
+    included_bundles = BUNDLES,
+    title = "XMPP Core Protocol Subsystem",
+    url = "https://wiki.onosproject.org/display/ONOS/XMPP+as+SBI",
+)
diff --git a/protocols/xmpp/core/api/BUILD b/protocols/xmpp/core/api/BUILD
new file mode 100644
index 0000000..29d19f1
--- /dev/null
+++ b/protocols/xmpp/core/api/BUILD
@@ -0,0 +1,9 @@
+COMPILE_DEPS = CORE_DEPS + [
+    "@tinder_xmpp//jar",
+    "@netty_transport//jar",
+    "@netty_common//jar",
+]
+
+osgi_jar_with_tests(
+    deps = COMPILE_DEPS,
+)
diff --git a/protocols/xmpp/core/ctl/BUILD b/protocols/xmpp/core/ctl/BUILD
new file mode 100644
index 0000000..8c521a1
--- /dev/null
+++ b/protocols/xmpp/core/ctl/BUILD
@@ -0,0 +1,22 @@
+COMPILE_DEPS = CORE_DEPS + [
+    "@netty_common//jar",
+    "@netty_transport//jar",
+    "@netty_transport_native_epoll//jar",
+    "@netty_buffer//jar",
+    "@netty_codec//jar",
+    "@tinder_xmpp//jar",
+    "@stax2_api//jar",
+    "@aalto_xml//jar",
+    "@concurrent_hashmap//jar",
+    "@gnu_idn//jar",
+    "//protocols/xmpp/core/api:onos-protocols-xmpp-core-api",
+]
+
+TEST_DEPS = TEST + [
+    "//core/api:onos-api-tests",
+]
+
+osgi_jar_with_tests(
+    test_deps = TEST_DEPS,
+    deps = COMPILE_DEPS,
+)
diff --git a/protocols/xmpp/pubsub/BUILD b/protocols/xmpp/pubsub/BUILD
new file mode 100644
index 0000000..6ce2904
--- /dev/null
+++ b/protocols/xmpp/pubsub/BUILD
@@ -0,0 +1,20 @@
+BUNDLES = [
+    "@tinder_xmpp//jar",
+    "@concurrent_hashmap//jar",
+    "@gnu_idn//jar",
+    "//protocols/xmpp/core/api:onos-protocols-xmpp-core-api",
+    "//protocols/xmpp/pubsub/api:onos-protocols-xmpp-pubsub-api",
+    "//protocols/xmpp/pubsub/ctl:onos-protocols-xmpp-pubsub-ctl",
+]
+
+onos_app(
+    app_name = "org.onosproject.protocols.xmpp.pubsub",
+    category = "Protocol",
+    description = "XMPP Publish/Subscribe protocol extension subsystem",
+    included_bundles = BUNDLES,
+    required_apps = [
+        "org.onosproject.protocols.xmpp",
+    ],
+    title = "XMPP Publish/Subscribe protocol extension subsystem",
+    url = "http://onosproject.org",
+)
diff --git a/protocols/xmpp/pubsub/api/BUILD b/protocols/xmpp/pubsub/api/BUILD
new file mode 100644
index 0000000..599a692
--- /dev/null
+++ b/protocols/xmpp/pubsub/api/BUILD
@@ -0,0 +1,7 @@
+COMPILE_DEPS = CORE_DEPS + [
+    "@tinder_xmpp//jar",
+]
+
+osgi_jar_with_tests(
+    deps = COMPILE_DEPS,
+)
diff --git a/protocols/xmpp/pubsub/ctl/BUILD b/protocols/xmpp/pubsub/ctl/BUILD
new file mode 100644
index 0000000..1b868ca
--- /dev/null
+++ b/protocols/xmpp/pubsub/ctl/BUILD
@@ -0,0 +1,16 @@
+COMPILE_DEPS = CORE_DEPS + [
+    "@tinder_xmpp//jar",
+    "@concurrent_hashmap//jar",
+    "@gnu_idn//jar",
+    "//protocols/xmpp/pubsub/api:onos-protocols-xmpp-pubsub-api",
+    "//protocols/xmpp/core/api:onos-protocols-xmpp-core-api",
+]
+
+TEST_DEPS = TEST + [
+    "//core/api:onos-api-tests",
+]
+
+osgi_jar_with_tests(
+    test_deps = TEST_DEPS,
+    deps = COMPILE_DEPS,
+)