ONOS-542 Added ability for app bundle to carry it's own artifacts, including feature repo. Fixed onos-package script. Added JSON output to CLI.
Change-Id: If4f2c774d3fc2d68c0a8e91b3084b99d7c75d927
diff --git a/tools/build/onos-package b/tools/build/onos-package
index 5a528ba..31551ea 100755
--- a/tools/build/onos-package
+++ b/tools/build/onos-package
@@ -46,9 +46,16 @@
sed "s/\$KARAF_VERSION/$KARAF_VERSION/g" \
$ONOS_ROOT/tools/package/bin/onos > bin/onos
-# Stage the ONOS bundles
+# Stage the ONOS bundles, but only those that match the version
mkdir -p $KARAF_DIST/system/org/onosproject
-cp -r $M2_REPO/org/onosproject $KARAF_DIST/system/org/
+# cp -r $M2_REPO/org/onosproject/ $KARAF_DIST/system/org/
+find $M2_REPO/org/onosproject/ -type d -name $ONOS_POM_VERSION | while read line; do
+ path=${line#*/onosproject/}
+ artifact=${path%/$ONOS_POM_VERSION}
+ mkdir -p $KARAF_DIST/system/org/onosproject/$artifact
+ cp -r $M2_REPO/org/onosproject/$artifact/$ONOS_POM_VERSION \
+ $KARAF_DIST/system/org/onosproject/$artifact/$ONOS_POM_VERSION
+done
export ONOS_FEATURES="${ONOS_FEATURES:-webconsole,onos-api,onos-core,onos-cli,onos-rest,onos-gui,onos-openflow,onos-app-fwd,onos-app-foo}"