updates to publish app and driver feature files

Change-Id: Id0789738df46a19a8356d6121ee0e5105f62d9a0
diff --git a/bucklets/onos_app.bucklet b/bucklets/onos_app.bucklet
index fa31479..6771c0b 100644
--- a/bucklets/onos_app.bucklet
+++ b/bucklets/onos_app.bucklet
@@ -25,6 +25,7 @@
         generate_file = False,
         visibility = [ 'PUBLIC' ],
         stage_repo = True,
+        maven_coords = None,
     ):
 
     if not feature_coords:
@@ -47,6 +48,7 @@
             bash = cmd,
             out = 'features.xml',
             visibility = visibility,
+            maven_coords = maven_coords,
     )
 
     if stage_repo:
@@ -95,6 +97,7 @@
         version = ONOS_VERSION,
         exported_deps = [],
         visibility = ['PUBLIC'],
+        maven_coords = None,
         **kwargs
     ):
     java_library(
@@ -112,6 +115,7 @@
             included_bundles = exported_deps,
             generate_file = False,
             visibility = visibility,
+            maven_coords = maven_coords,
     )
 
 
@@ -140,6 +144,7 @@
         app_name = _get_app_name()
 
     maven_coords = '%s:%s:oar:%s' % ( ONOS_GROUP_ID, name, ONOS_VERSION )
+    feature_xml_coords = '%s:%s:xml:features:%s' % ( ONOS_GROUP_ID, name, ONOS_VERSION )
 
     if title is None:
         print "Missing title for %s" % _get_name()
@@ -186,6 +191,7 @@
         generate_file = True,
         visibility = [],
         stage_repo = False,
+        maven_coords = feature_xml_coords,
     )
 
     cmd = '$(exe //buck-tools:onos-app-writer) -A ' + ' '.join(args) + ' > $OUT'
diff --git a/tools/build/onos-buck-publish b/tools/build/onos-buck-publish
index aa56dea..d7d0202 100755
--- a/tools/build/onos-buck-publish
+++ b/tools/build/onos-buck-publish
@@ -19,8 +19,6 @@
 
 # Prepare artifact publish commands
 onos-buck query "kind('onos_jar', deps('//tools/package:onos-package'))" >> $ARTIFACT_PUB
-onos-buck query "filter('.*-oar', deps('//tools/package:onos-package', 1))" >> $ARTIFACT_PUB
-echo "//tools/package:onos-features" >> $ARTIFACT_PUB
 
 sed -i.bak 's/^/onos-buck publish --to-maven-central --include-source --include-javadoc --sign /g' $ARTIFACT_PUB
 
@@ -28,8 +26,14 @@
 cat $ARTIFACT_PUB
 bash $ARTIFACT_PUB
 
-# Prepare test publish commands
+# Prepare apps commands
+onos-buck query "filter('.*-oar', deps('//tools/package:onos-package', 1))" >> $ARTIFACT_PUB
+# Prepare feature commands
+onos-buck query "filter('.*-feature', deps(filter('.*-oar', deps('//tools/package:onos-package', 1)),1))" >> $ARTIFACT_PUB
+echo "//tools/package:onos-features" >> $ARTIFACT_PUB
+# Prepare test commands
 onos-buck query "testsof(kind('onos_jar', deps('//tools/package:onos-package')))" >> $TEST_PUB
+
 sed -i.bak 's#^#onos-buck publish --to-maven-central --sign #g' $TEST_PUB
 
 # Print commands to be run and then run them