app buck refactor for apps: aaa, acl, bgprouter
Change-Id: Iaa970e3a937cc1df0aff29cc45f4c08c2d79cd13
diff --git a/BUCK b/BUCK
index 63a1995..e132bdf 100644
--- a/BUCK
+++ b/BUCK
@@ -86,15 +86,16 @@
APPS = [
'//apps/dhcp:onos-apps-dhcp-oar',
'//apps/fwd:onos-apps-fwd-oar',
+ '//apps/aaa:onos-apps-aaa-oar',
+ '//apps/acl:onos-apps-acl-oar',
+ '//apps/bgprouter:onos-apps-bgprouter-oar',
+ '//apps/proxyarp:onos-apps-proxyarp-oar',
]
APP_JARS = [
'//apps/cpman/api:onos-app-cpman-api',
'//apps/cpman/app:onos-app-cpman-app',
- '//apps/aaa:onos-app-aaa',
- '//apps/acl:onos-app-acl',
- '//apps/bgprouter:onos-app-bgprouter',
- '//apps/routing-api:onos-app-routing-api',
+ '//apps/routing-api:onos-apps-routing-api',
'//apps/cip:onos-app-cip',
'//apps/cordmcast:onos-app-cord-mcast',
'//apps/cordvtn:onos-apps-cordvtn',
@@ -123,8 +124,7 @@
'//apps/optical:onos-app-optical',
'//apps/pathpainter:onos-app-pp',
'//apps/pim:onos-app-pim',
- '//apps/proxyarp:onos-app-proxyarp',
- '//apps/routing:onos-app-routing',
+ '//apps/routing:onos-apps-routing',
'//apps/sdnip:onos-app-sdnip',
'//apps/segmentrouting:onos-app-segmentrouting',
'//apps/test:onos-app-test',
diff --git a/apps/aaa/BUCK b/apps/aaa/BUCK
index da39409..2fe2ca5 100644
--- a/apps/aaa/BUCK
+++ b/apps/aaa/BUCK
@@ -1,9 +1,3 @@
-SRC = 'src/main/java/org/onosproject/**/'
-TEST = 'src/test/java/org/onosproject/**/'
-
-CURRENT_NAME = 'onos-app-aaa'
-CURRENT_TARGET = ':' + CURRENT_NAME
-
COMPILE_DEPS = [
'//lib:CORE_DEPS',
'//lib:org.apache.karaf.shell.console',
@@ -15,18 +9,14 @@
'//core/common:onos-core-common',
]
-java_library(
- name = CURRENT_NAME,
- srcs = glob([SRC + '/*.java']),
+osgi_jar_with_tests (
deps = COMPILE_DEPS,
- visibility = ['PUBLIC'],
+ test_deps = TEST_DEPS,
)
-java_test(
- name = 'tests',
- srcs = glob([TEST + '/*.java']),
- deps = COMPILE_DEPS +
- TEST_DEPS +
- [CURRENT_TARGET],
- source_under_test = [CURRENT_TARGET],
+onos_app (
+ title = 'Authentication App',
+ category = 'Security',
+ url = 'http://onosproject.org',
+ description = 'ONOS authentication application.',
)
diff --git a/apps/acl/BUCK b/apps/acl/BUCK
index 8b509fd..fcea504 100644
--- a/apps/acl/BUCK
+++ b/apps/acl/BUCK
@@ -1,9 +1,3 @@
-SRC = 'src/main/java/org/onosproject/**/'
-TEST = 'src/test/java/org/onosproject/**/'
-
-CURRENT_NAME = 'onos-app-acl'
-CURRENT_TARGET = ':' + CURRENT_NAME
-
COMPILE_DEPS = [
'//lib:CORE_DEPS',
'//lib:javax.ws.rs-api',
@@ -16,18 +10,15 @@
'//lib:jersey-server',
]
-java_library(
- name = CURRENT_NAME,
- srcs = glob([SRC + '/*.java']),
+osgi_jar_with_tests (
deps = COMPILE_DEPS,
- visibility = ['PUBLIC'],
+ test_deps = TEST_DEPS,
+ web_context = '/onos/v1/acl',
)
-java_test(
- name = 'tests',
- srcs = glob([TEST + '/*.java']),
- deps = COMPILE_DEPS +
- TEST_DEPS +
- [CURRENT_TARGET],
- source_under_test = [CURRENT_TARGET],
+onos_app (
+ title = 'ACL App',
+ category = 'Security',
+ url = 'http://onosproject.org',
+ description = 'ONOS ACL application.',
)
diff --git a/apps/bgprouter/BUCK b/apps/bgprouter/BUCK
index 3d39bc1..62ec78e 100644
--- a/apps/bgprouter/BUCK
+++ b/apps/bgprouter/BUCK
@@ -1,31 +1,24 @@
-SRC = 'src/main/java/org/onosproject/**/'
-TEST = 'src/test/java/org/onosproject/**/'
-
-CURRENT_NAME = 'onos-app-bgprouter'
-CURRENT_TARGET = ':' + CURRENT_NAME
-
COMPILE_DEPS = [
'//lib:CORE_DEPS',
'//incubator/api:onos-incubator-api',
- '//apps/routing-api:onos-app-routing-api',
+ '//apps/routing-api:onos-apps-routing-api',
]
-TEST_DEPS = [
- '//lib:TEST',
+BUNDLES = [
+ '//apps/routing-api:onos-apps-routing-api',
+ '//apps/routing:onos-apps-routing',
+ '//apps/bgprouter:onos-apps-bgprouter',
]
-java_library(
- name = CURRENT_NAME,
- srcs = glob([SRC + '/*.java']),
+osgi_jar (
deps = COMPILE_DEPS,
- visibility = ['PUBLIC'],
)
-java_test(
- name = 'tests',
- srcs = glob([TEST + '/*.java']),
- deps = COMPILE_DEPS +
- TEST_DEPS +
- [CURRENT_TARGET],
- source_under_test = [CURRENT_TARGET],
+onos_app (
+ title = 'BGP Router App',
+ category = 'Traffic Steering',
+ url = 'http://onosproject.org',
+ description = 'BGP router application.',
+ required_apps = [ 'org.onosproject.proxyarp' ],
+ included_bundles = BUNDLES,
)
diff --git a/apps/dhcp/BUCK b/apps/dhcp/BUCK
index 1be783a..1bd1876 100644
--- a/apps/dhcp/BUCK
+++ b/apps/dhcp/BUCK
@@ -3,8 +3,7 @@
'//apps/dhcp/app:onos-apps-dhcp-app',
]
-onos_app(
- feature_coords = ONOS_GROUP_ID + ':onos-apps-dhcp:' + ONOS_VERSION,
+onos_app (
title = 'DHCP Server App',
category = 'Utility',
url = 'http://onosproject.org',
diff --git a/apps/fwd/BUCK b/apps/fwd/BUCK
index 148d380..565e275 100644
--- a/apps/fwd/BUCK
+++ b/apps/fwd/BUCK
@@ -4,13 +4,13 @@
'//cli:onos-cli',
]
-osgi_jar(
+osgi_jar_with_tests (
deps = COMPILE_DEPS,
)
-onos_app(
+onos_app (
title = 'Reactive Forwarding App',
category = 'Traffic Steering',
url = 'http://onosproject.org',
description = 'Reactive forwarding application using flow subsystem.',
-)
\ No newline at end of file
+)
diff --git a/apps/pim/BUCK b/apps/pim/BUCK
index 2fa4c60..02c4cfb 100644
--- a/apps/pim/BUCK
+++ b/apps/pim/BUCK
@@ -9,7 +9,7 @@
'//lib:org.apache.karaf.shell.console',
'//cli:onos-cli',
'//incubator/api:onos-incubator-api',
- '//apps/routing-api:onos-app-routing-api',
+ '//apps/routing-api:onos-apps-routing-api',
]
TEST_DEPS = [
diff --git a/apps/proxyarp/BUCK b/apps/proxyarp/BUCK
index db784ae..5406f4e 100644
--- a/apps/proxyarp/BUCK
+++ b/apps/proxyarp/BUCK
@@ -1,29 +1,14 @@
-SRC = 'src/main/java/org/onosproject/**/'
-TEST = 'src/test/java/org/onosproject/**/'
-
-CURRENT_NAME = 'onos-app-proxyarp'
-CURRENT_TARGET = ':' + CURRENT_NAME
-
COMPILE_DEPS = [
'//lib:CORE_DEPS',
]
-TEST_DEPS = [
- '//lib:TEST',
-]
-
-java_library(
- name = CURRENT_NAME,
- srcs = glob([SRC + '/*.java']),
+osgi_jar (
deps = COMPILE_DEPS,
- visibility = ['PUBLIC'],
)
-java_test(
- name = 'tests',
- srcs = glob([TEST + '/*.java']),
- deps = COMPILE_DEPS +
- TEST_DEPS +
- [CURRENT_TARGET],
- source_under_test = [CURRENT_TARGET],
+onos_app (
+ title = 'Proxy ARP/NDP App',
+ category = 'Traffic Steering',
+ url = 'http://onosproject.org',
+ description = 'Proxy ARP/NDP application.',
)
diff --git a/apps/routing-api/BUCK b/apps/routing-api/BUCK
index 35f868d..d9db85a 100644
--- a/apps/routing-api/BUCK
+++ b/apps/routing-api/BUCK
@@ -1,9 +1,3 @@
-SRC = 'src/main/java/org/onosproject/**/'
-TEST = 'src/test/java/org/onosproject/**/'
-
-CURRENT_NAME = 'onos-app-routing-api'
-CURRENT_TARGET = ':' + CURRENT_NAME
-
COMPILE_DEPS = [
'//lib:CORE_DEPS',
]
@@ -12,19 +6,8 @@
'//lib:TEST_ADAPTERS',
]
-java_library(
- name = CURRENT_NAME,
- srcs = glob([SRC + '/*.java']),
+osgi_jar_with_tests (
deps = COMPILE_DEPS,
- visibility = ['PUBLIC'],
+ test_deps = TEST_DEPS,
)
-java_test(
- name = 'onos-app-routing-api-tests',
- srcs = glob([TEST + '/*.java']),
- deps = COMPILE_DEPS +
- TEST_DEPS +
- [CURRENT_TARGET],
- source_under_test = [CURRENT_TARGET],
- visibility = ['PUBLIC'],
-)
diff --git a/apps/routing/BUCK b/apps/routing/BUCK
index b725adf..8483685 100644
--- a/apps/routing/BUCK
+++ b/apps/routing/BUCK
@@ -1,39 +1,20 @@
-SRC = 'src/main/java/org/onosproject/**/'
-TEST = 'src/test/java/org/onosproject/**/'
-
-CURRENT_NAME = 'onos-app-routing'
-CURRENT_TARGET = ':' + CURRENT_NAME
-
COMPILE_DEPS = [
'//lib:CORE_DEPS',
'//lib:org.apache.karaf.shell.console',
'//lib:concurrent-trees',
'//cli:onos-cli',
'//incubator/api:onos-incubator-api',
- '//apps/routing-api:onos-app-routing-api',
+ '//apps/routing-api:onos-apps-routing-api',
'//core/common:onos-core-common',
]
TEST_DEPS = [
'//lib:TEST_ADAPTERS',
'//incubator/api:onos-incubator-api-tests',
- '//apps/routing-api:onos-app-routing-api-tests',
+ '//apps/routing-api:onos-apps-routing-api-tests',
]
-java_library(
- name = CURRENT_NAME,
- srcs = glob([SRC + '/*.java']),
+osgi_jar_with_tests (
deps = COMPILE_DEPS,
- visibility = ['PUBLIC'],
- resources_root = 'src/main/resources',
- resources = glob(['src/main/resources/**']),
-)
-
-java_test(
- name = 'tests',
- srcs = glob([TEST + '/*.java']),
- deps = COMPILE_DEPS +
- TEST_DEPS +
- [CURRENT_TARGET],
- source_under_test = [CURRENT_TARGET],
+ test_deps = TEST_DEPS,
)
diff --git a/apps/sdnip/BUCK b/apps/sdnip/BUCK
index 9fdb1c4..d0bd4fd 100644
--- a/apps/sdnip/BUCK
+++ b/apps/sdnip/BUCK
@@ -7,13 +7,13 @@
COMPILE_DEPS = [
'//lib:CORE_DEPS',
'//incubator/api:onos-incubator-api',
- '//apps/routing-api:onos-app-routing-api',
+ '//apps/routing-api:onos-apps-routing-api',
]
TEST_DEPS = [
'//lib:TEST_ADAPTERS',
'//incubator/api:onos-incubator-api-tests',
- '//apps/routing-api:onos-app-routing-api-tests',
+ '//apps/routing-api:onos-apps-routing-api-tests',
]
java_library(
diff --git a/apps/segmentrouting/BUCK b/apps/segmentrouting/BUCK
index 5f27c94..5dbb487 100644
--- a/apps/segmentrouting/BUCK
+++ b/apps/segmentrouting/BUCK
@@ -10,7 +10,7 @@
'//lib:javax.ws.rs-api',
'//cli:onos-cli',
'//incubator/api:onos-incubator-api',
- '//apps/routing-api:onos-app-routing-api',
+ '//apps/routing-api:onos-apps-routing-api',
'//utils/rest:onlab-rest',
]
diff --git a/apps/vpls/BUCK b/apps/vpls/BUCK
index fe84ee8..745db32 100644
--- a/apps/vpls/BUCK
+++ b/apps/vpls/BUCK
@@ -12,7 +12,7 @@
'//cli:onos-cli',
'//utils/rest:onlab-rest',
'//incubator/api:onos-incubator-api',
- '//apps/routing-api:onos-app-routing-api',
+ '//apps/routing-api:onos-apps-routing-api',
]
TEST_DEPS = [
diff --git a/bucklets/onos_app.bucklet b/bucklets/onos_app.bucklet
index d95427e..476bdac 100644
--- a/bucklets/onos_app.bucklet
+++ b/bucklets/onos_app.bucklet
@@ -1,8 +1,9 @@
ONOS_ORIGIN = 'ON.Lab'
+ONOS_GROUP_ID = 'org.onosproject'
ONOS_VERSION = '1.6.0-SNAPSHOT'
DEFAULT_APP_CATEGORY = 'Utility'
ONOS_ARTIFACT_BASE = 'onos-'
-APP_PREFIX = 'org.onosproject.'
+APP_PREFIX = ONOS_GROUP_ID + '.'
import os.path
@@ -50,8 +51,7 @@
feature_coords = '$(maven_coords %s)' % included_bundles[0]
if not feature_coords:
- print 'Missing maven coordinates for %s app feature.' % name
- return
+ feature_coords = '%s:%s:%s' % ( ONOS_GROUP_ID, _get_name(), ONOS_VERSION )
args = [ '-n %s' % feature_coords,
'-v %s' % version,