Buckifying DHCP app

Change-Id: I9af53efa8bb0294f5f2c677ac2d8bb0b5e4cf282
diff --git a/apps/dhcp/BUCK b/apps/dhcp/BUCK
new file mode 100644
index 0000000..5c811d8
--- /dev/null
+++ b/apps/dhcp/BUCK
@@ -0,0 +1,14 @@
+
+BUNDLES = [
+    ('//apps/dhcp/api:onos-app-dhcp-api', ONOS_GROUP_ID + ':' + 'onos-app-dhcp-api' + ':' + ONOS_VERSION),
+    ('//apps/dhcp/app:onos-app-dhcp-app', ONOS_GROUP_ID + ':' + 'onos-app-dhcp-app' + ':' + ONOS_VERSION),
+]
+
+onos_app(
+  app_name = 'org.onosproject.dhcp',
+  feature_name = ONOS_GROUP_ID + ':onos-app-dhcp:' + ONOS_VERSION,
+  title = 'DHCP Server App',
+  category = 'Utility',
+  url = 'http://onosproject.org',
+  included_bundles = BUNDLES,
+)
diff --git a/apps/dhcp/api/BUCK b/apps/dhcp/api/BUCK
index e86c13b..9989504 100644
--- a/apps/dhcp/api/BUCK
+++ b/apps/dhcp/api/BUCK
@@ -12,7 +12,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/apps/dhcp/app/BUCK b/apps/dhcp/app/BUCK
index 5fa8ca7..a3b4ea1 100644
--- a/apps/dhcp/app/BUCK
+++ b/apps/dhcp/app/BUCK
@@ -1,8 +1,4 @@
-SRC = 'src/main/java/org/onosproject/**/'
-TEST = 'src/test/java/org/onosproject/**/'
-
 CURRENT_NAME = 'onos-app-dhcp-app'
-CURRENT_TARGET = ':' + CURRENT_NAME
 
 COMPILE_DEPS = [
     '//lib:CORE_DEPS',
@@ -18,18 +14,12 @@
     '//lib:TEST_ADAPTERS',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
-    srcs = glob([SRC + '/*.java']),
     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],
+    srcs = glob([SRC + '/*.java']),
+    resources = glob([RESOURCES_ROOT + '**']),
+    test_srcs = glob([TEST + '/*.java']),
+    test_deps = TEST_DEPS,
+    web_context = '/onos/dhcp',
 )