From 02a658bb4a1e2fcb8b67c092e1141b6b86650a49 Mon Sep 17 00:00:00 2001 From: Ray Milkey Date: Wed, 13 Jun 2018 08:52:39 -0700 Subject: [PATCH] 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 --- apps/route-service/BUILD | 11 +++++++++++ apps/route-service/api/BUILD | 10 ++++++++++ apps/route-service/app/BUILD | 26 ++++++++++++++++++++++++++ apps/segmentrouting/BUILD | 13 +++++++++++++ apps/segmentrouting/app/BUILD | 21 +++++++++++++++++++++ apps/segmentrouting/web/BUILD | 14 ++++++++++++++ tools/build/bazel/onos_app.bzl | 6 ++++-- 7 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 apps/route-service/BUILD create mode 100644 apps/route-service/api/BUILD create mode 100644 apps/route-service/app/BUILD create mode 100644 apps/segmentrouting/BUILD create mode 100644 apps/segmentrouting/app/BUILD create mode 100644 apps/segmentrouting/web/BUILD diff --git a/apps/route-service/BUILD b/apps/route-service/BUILD new file mode 100644 index 0000000000..ad4fe6fcc5 --- /dev/null +++ b/apps/route-service/BUILD @@ -0,0 +1,11 @@ +BUNDLES = [ + "//apps/route-service/api:onos-apps-route-service-api", + "//apps/route-service/app:onos-apps-route-service-app", +] + +onos_app ( + title = 'Route Service Server', + category = 'Utility', + url = 'http://onosproject.org', + included_bundles = BUNDLES, +) diff --git a/apps/route-service/api/BUILD b/apps/route-service/api/BUILD new file mode 100644 index 0000000000..f33e002f28 --- /dev/null +++ b/apps/route-service/api/BUILD @@ -0,0 +1,10 @@ +COMPILE_DEPS = CORE_DEPS + JACKSON + +TEST_DEPS = TEST + [ + '//core/api:onos-api-tests', +] + +osgi_jar_with_tests ( + deps = COMPILE_DEPS, + test_deps = TEST_DEPS, +) diff --git a/apps/route-service/app/BUILD b/apps/route-service/app/BUILD new file mode 100644 index 0000000000..aa8b7f8a9e --- /dev/null +++ b/apps/route-service/app/BUILD @@ -0,0 +1,26 @@ +COMPILE_DEPS = CORE_DEPS + JACKSON + KRYO + [ + "@org_apache_karaf_shell_console//jar", + '@concurrent_trees//jar', + '@javax_ws_rs_api//jar', + '@jersey_server//jar', + '//core/store/serializers:onos-core-serializers', + '//apps/route-service/api:onos-apps-route-service-api', + '//cli:onos-cli', + '//utils/rest:onlab-rest', +] + +TEST_DEPS = [ + '//lib:TEST', + '//apps/route-service/api:onos-apps-route-service-api-tests', + '//core/api:onos-api-tests', +] + +osgi_jar_with_tests ( + deps = COMPILE_DEPS, + test_deps = TEST_DEPS, + #web_context = '/onos/routeservice', + #api_title = 'Route Service App', + #api_version = '1.0', + #api_description = 'REST API for Route Service App', + #api_package = 'org.onosproject.routeservice.rest', +) diff --git a/apps/segmentrouting/BUILD b/apps/segmentrouting/BUILD new file mode 100644 index 0000000000..c03ace3f6b --- /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 0000000000..535479c5ad --- /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 0000000000..05bc4a8faa --- /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', +) diff --git a/tools/build/bazel/onos_app.bzl b/tools/build/bazel/onos_app.bzl index 793ecc4413..fb2840a3ee 100644 --- a/tools/build/bazel/onos_app.bzl +++ b/tools/build/bazel/onos_app.bzl @@ -100,11 +100,13 @@ def _onos_app_xml_impl(ctx): ] for bundle in included_bundles: - arguments += ["-b", maven_coordinates(bundle.label)] + arguments += ["-b", maven_coordinates(bundle.label).replace("mvn:", "")] for bundle in excluded_bundles: - arguments += ["-e", maven_coordinates(bundle.label)] + arguments += ["-e", maven_coordinates(bundle.label).replace("mvn:", "")] for feature in required_features: arguments += ["-f", feature] + for app in required_apps: + arguments += ["-d", app] if security != "": arguments += ["-s", security]