Simplifying rules and providing sensible defaults

Updated cordvtn, dhcp, fwd, onos-api, of-api, onlab-rest, onos-rest, onos-gui

Also, fixed checkstyle error print

Change-Id: I9d6ab76791e8603678079067a3b4e007ca7c4667
diff --git a/apps/cordvtn/BUCK b/apps/cordvtn/BUCK
index 27ca9ce..2f0387c 100644
--- a/apps/cordvtn/BUCK
+++ b/apps/cordvtn/BUCK
@@ -1,9 +1,3 @@
-SRC = 'src/main/java/org/onosproject/**/'
-TEST = 'src/test/java/org/onosproject/**/'
-
-CURRENT_NAME = 'onos-app-cordvtn'
-CURRENT_TARGET = ':' + CURRENT_NAME
-
 COMPILE_DEPS = [
     '//lib:CORE_DEPS',
     '//lib:org.apache.karaf.shell.console',
@@ -13,29 +7,14 @@
     '//cli:onos-cli',
     '//core/store/serializers:onos-core-serializers',
     '//apps/openstackinterface:onos-app-openstackinterface-api',
-    '//apps/dhcp/api:onos-app-dhcp-api',
+    '//apps/dhcp/api:onos-apps-dhcp-api',
     '//protocols/ovsdb/api:onos-ovsdb-api',
     '//protocols/ovsdb/rfc:onos-ovsdb-rfc',
 ]
 
-TEST_DEPS = [
-    '//lib:TEST',
-]
-
-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/**']),
+    web_context = '/onos/cordvtn',
 )
 
-java_test(
-    name = 'tests',
-    srcs = glob([TEST + '/*.java']),
-    deps = COMPILE_DEPS +
-           TEST_DEPS +
-           [CURRENT_TARGET],
-    source_under_test = [CURRENT_TARGET],
-)
+#FIXME need onos_app
\ No newline at end of file
diff --git a/apps/dhcp/BUCK b/apps/dhcp/BUCK
index 4affce2..1be783a 100644
--- a/apps/dhcp/BUCK
+++ b/apps/dhcp/BUCK
@@ -1,11 +1,10 @@
 BUNDLES = [
-    '//apps/dhcp/api:onos-app-dhcp-api',
-    '//apps/dhcp/app:onos-app-dhcp-app',
+    '//apps/dhcp/api:onos-apps-dhcp-api',
+    '//apps/dhcp/app:onos-apps-dhcp-app',
 ]
 
 onos_app(
-  app_name = 'org.onosproject.dhcp',
-  feature_coords = ONOS_GROUP_ID + ':onos-app-dhcp:' + ONOS_VERSION,
+  feature_coords = ONOS_GROUP_ID + ':onos-apps-dhcp:' + ONOS_VERSION,
   title = 'DHCP Server App',
   category = 'Utility',
   url = 'http://onosproject.org',
diff --git a/apps/dhcp/api/BUCK b/apps/dhcp/api/BUCK
index 9989504..ee55792 100644
--- a/apps/dhcp/api/BUCK
+++ b/apps/dhcp/api/BUCK
@@ -1,29 +1,7 @@
-SRC = 'src/main/java/org/onosproject/**/'
-TEST = 'src/test/java/org/onosproject/**/'
-
-CURRENT_NAME = 'onos-app-dhcp-api'
-CURRENT_TARGET = ':' + CURRENT_NAME
-
 COMPILE_DEPS = [
     '//lib:CORE_DEPS',
 ]
 
-TEST_DEPS = [
-    '//lib:TEST',
-]
-
-osgi_jar(
-    name = CURRENT_NAME,
-    srcs = glob([SRC + '/*.java']),
+osgi_jar_with_tests (
     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],
-)
+)
\ No newline at end of file
diff --git a/apps/dhcp/app/BUCK b/apps/dhcp/app/BUCK
index a3b4ea1..df15319 100644
--- a/apps/dhcp/app/BUCK
+++ b/apps/dhcp/app/BUCK
@@ -1,10 +1,8 @@
-CURRENT_NAME = 'onos-app-dhcp-app'
-
 COMPILE_DEPS = [
     '//lib:CORE_DEPS',
     '//lib:javax.ws.rs-api',
     '//lib:org.apache.karaf.shell.console',
-    '//apps/dhcp/api:onos-app-dhcp-api',
+    '//apps/dhcp/api:onos-apps-dhcp-api',
     '//utils/rest:onlab-rest',
     '//core/store/serializers:onos-core-serializers',
     '//cli:onos-cli',
@@ -14,12 +12,8 @@
     '//lib:TEST_ADAPTERS',
 ]
 
-osgi_jar(
-    name = CURRENT_NAME,
+osgi_jar_with_tests (
     deps = COMPILE_DEPS,
-    srcs = glob([SRC + '/*.java']),
-    resources = glob([RESOURCES_ROOT + '**']),
-    test_srcs = glob([TEST + '/*.java']),
     test_deps = TEST_DEPS,
     web_context = '/onos/dhcp',
 )
diff --git a/apps/fwd/BUCK b/apps/fwd/BUCK
index 9cb77c4..148d380 100644
--- a/apps/fwd/BUCK
+++ b/apps/fwd/BUCK
@@ -1,30 +1,16 @@
-CURRENT_NAME = 'onos-app-fwd'
-CURRENT_TARGET = ':' + CURRENT_NAME
-
 COMPILE_DEPS = [
     '//lib:CORE_DEPS',
     '//lib:org.apache.karaf.shell.console',
     '//cli:onos-cli',
 ]
 
-TEST_DEPS = [
-    '//lib:TEST',
-]
-
 osgi_jar(
-    name = CURRENT_NAME,
-    srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
-    test_srcs = glob([TEST + '/*.java']),
-    test_deps = TEST_DEPS,
-    visibility = ['PUBLIC'],
 )
 
 onos_app(
-    app_name = 'org.onosproject.fwd',
     title = 'Reactive Forwarding App',
     category = 'Traffic Steering',
     url = 'http://onosproject.org',
     description = 'Reactive forwarding application using flow subsystem.',
-    included_bundles = [ CURRENT_TARGET ],
 )
\ No newline at end of file