Build segment routing app with bazel

- add support for apps depending on other apps
- build files for route-service and segment routing

Change-Id: I4850aacfe050f802072e2d59a6a21bcefd784e67
diff --git a/apps/segmentrouting/BUILD b/apps/segmentrouting/BUILD
new file mode 100644
index 0000000..c03ace3
--- /dev/null
+++ b/apps/segmentrouting/BUILD
@@ -0,0 +1,13 @@
+BUNDLES = [
+    '//apps/segmentrouting/app:onos-apps-segmentrouting-app',
+    '//apps/segmentrouting/web:onos-apps-segmentrouting-web',
+]
+
+onos_app (
+    title = 'Segment Routing',
+    category = 'Traffic Steering',
+    url = 'http://onosproject.org',
+    included_bundles = BUNDLES,
+    description = 'Segment routing application.',
+    required_apps = [ 'org.onosproject.route-service', 'org.onosproject.mcast' ],
+)
diff --git a/apps/segmentrouting/app/BUILD b/apps/segmentrouting/app/BUILD
new file mode 100644
index 0000000..535479c5
--- /dev/null
+++ b/apps/segmentrouting/app/BUILD
@@ -0,0 +1,21 @@
+COMPILE_DEPS = CORE_DEPS + JACKSON + KRYO + [
+    "@org_apache_karaf_shell_console//jar",
+    '//cli:onos-cli',
+    '//core/common:onos-core-common',
+    '//core/store/serializers:onos-core-serializers',
+    '//incubator/api:onos-incubator-api',
+    '//apps/route-service/api:onos-apps-route-service-api',
+    '//apps/mcast/api:onos-apps-mcast-api',
+    '//apps/mcast/cli:onos-apps-mcast-cli',
+]
+
+TEST_DEPS = TEST_ADAPTERS + [
+    '//core/net:onos-core-net',
+    '//incubator/api:onos-incubator-api-tests',
+    '//apps/route-service/api:onos-apps-route-service-api-tests',
+]
+
+osgi_jar_with_tests (
+    deps = COMPILE_DEPS,
+    test_deps = TEST_DEPS,
+)
diff --git a/apps/segmentrouting/web/BUILD b/apps/segmentrouting/web/BUILD
new file mode 100644
index 0000000..05bc4a8
--- /dev/null
+++ b/apps/segmentrouting/web/BUILD
@@ -0,0 +1,14 @@
+COMPILE_DEPS = CORE_DEPS + JACKSON + [
+    '@javax_ws_rs_api//jar',
+    '//utils/rest:onlab-rest',
+    '//apps/segmentrouting/app:onos-apps-segmentrouting-app',
+]
+
+osgi_jar_with_tests (
+    deps = COMPILE_DEPS,
+    #web_context = '/onos/segmentrouting',
+    #api_title = 'Segment Routing Rest Server',
+    #api_version = '1.0',
+    #api_description = 'REST API for Segment Routing Application',
+    #api_package = 'org.onosproject.segmentrouting.web',
+)