Using $(maven_coords :target) marco

Note: This this macro is not yet available on buck master

Also, simplifying app/fwd buck file and improving onos_app
readability by using feature_coords instead of feature_name

Change-Id: I9aff07d66331a537f6711bf15fd760cf910f1afc
diff --git a/bucklets/onos.bucklet b/bucklets/onos.bucklet
index 37a0864..d64ba16 100644
--- a/bucklets/onos.bucklet
+++ b/bucklets/onos.bucklet
@@ -93,8 +93,6 @@
     visibility = visibility,
   )
 
-
-
   ### Checkstyle
   chk_cmd = ' '.join(( 'java -jar $(location //lib:checkstyle)',
                        '-o $OUT',
@@ -132,7 +130,7 @@
   if test_resources and not test_resources_root:
       test_resources_root = RESOURCES_ROOT
 
-  if test_srcs:
+  if test_srcs is not None:
       java_test(
         name = 'tests',
         srcs = test_srcs,
diff --git a/bucklets/onos_app.bucklet b/bucklets/onos_app.bucklet
index 027d4fe..ba76649 100644
--- a/bucklets/onos_app.bucklet
+++ b/bucklets/onos_app.bucklet
@@ -11,17 +11,17 @@
         url = None,
         description = None, #TODO make this a file
         #TODO icon,
-        feature_name = None,
+        feature_coords = None,
         required_features = [ 'onos-api' ],
         required_apps = [],
         included_bundles = [],
         excluded_bundles = [],
         **kwargs):
 
-    if not feature_name and len(included_bundles) == 1:
-        feature_name = included_bundles[0][1]
+    if not feature_coords and len(included_bundles) == 1:
+        feature_coords = '$(maven_coords %s)' % included_bundles[0]
 
-    args = [ '-n %s' % feature_name,
+    args = [ '-n %s' % feature_coords,
              '-v %s' % version,
              '-t "%s"' % title,
              '-o "%s"' % origin,
@@ -30,15 +30,15 @@
              '-u %s' % url,
              ]
     args += [ '-f %s' % f for f in required_features ]
-    args += [ '-b %s' % b for (t, b) in included_bundles ]
-    args += [ '-e %s' % b for (t, b) in excluded_bundles ]
+    args += [ '-b $(maven_coords %s)' % b for b in included_bundles ]
+    args += [ '-e $(maven_coords %s)' % b for b in excluded_bundles ]
     args += [ '-d %s' % a for a in required_apps ]
 
     cmd = '$(exe //buck-tools:onos-app-writer) -F ' + ' '.join(args) + ' > $OUT'
     genrule(
         name = 'app-features',
         bash = cmd,
-        out = '%s-%s-features.xml' % (feature_name.split(':')[1], version),
+        out = 'features.xml',
         visibility = [],
     )
     cmd = '$(exe //buck-tools:onos-app-writer) -A ' + ' '.join(args) + ' > $OUT'
@@ -50,10 +50,10 @@
     )
 
     sources = [
-        '$(location :app-features) %s' % feature_name,
+        '$(location :app-features) %s' % feature_coords,
         '$(location :app-xml) NONE',
     ]
-    sources += ['$(location %s) %s' % i for i in included_bundles]
+    sources += ['$(location %s) $(maven_coords %s)' % (i, i) for i in included_bundles]
     genrule(
         name = 'app-oar',
         out = 'app.oar',