Extending the versioning to cover BUCK artifacts.

Adding ability to version extraneous stuff.

Change-Id: I2e18dafd6d8705504ab01000d6707037415dfd0c
(cherry picked from commit 251016df5db8f11a14c4856f9b381e85ae1e2631)
diff --git a/tools/build/onos-change-version b/tools/build/onos-change-version
index 1eb328b..0e02590 100755
--- a/tools/build/onos-change-version
+++ b/tools/build/onos-change-version
@@ -17,6 +17,8 @@
 
 # Augment the version of the main pom and the modules nested underneath.
 mvn versions:set -DnewVersion=$NEW_VERSION versions:commit
+mvn -f lib/pom.xml versions:set -DnewVersion=$NEW_VERSION versions:commit
+sed -i "" -E "1,/<version>/s/<version>[^<]*</<version>$NEW_VERSION</g" pom.xml
 
 # Augment the version of the Java API pom files and the overview.html file.
 for pom in docs/internal.xml docs/external.xml; do
@@ -46,3 +48,10 @@
 perl -i -0pe "s#<artifactId>cord-gui<.*\n.*version>#<artifactId>cord-gui</artifactId>\n    <version>$NEW_VERSION</version>#" $ONOS_ROOT/apps/demo/cord-gui/pom.xml
 sed -i "" -E "s#demo/cord-gui/target/cord-gui-.*\.war#demo/cord-gui/target/cord-gui-$NEW_VERSION.war#" $ONOS_ROOT/apps/demo/cord-gui/src/scripts/pullwar.sh
 sed -i "" -E "s#CORD=./cord-gui-.*\.war#CORD=./cord-gui-$NEW_VERSION.war#" $ONOS_ROOT/apps/demo/cord-gui/src/scripts/run.me
+
+# Version the BUCK artifacts
+sed -i "" -E "s#/org/onosproject/onos-features/.*/#/org/onosproject/onos-features/$NEW_VERSION/#" $ONOS_ROOT/buck-tools/onos_stage.py
+sed -i "" -E "s#onos-features-.*-features.xml#onos-features-$NEW_VERSION-features.xml#" $ONOS_ROOT/buck-tools/onos_stage.py
+
+sed -i "" -E "s#ONOS_VERSION = .*#ONOS_VERSION = '$NEW_VERSION'#" $ONOS_ROOT/bucklets/onos.bucklet
+sed -i "" -E "s#ONOS_VERSION = .*#ONOS_VERSION = '$NEW_VERSION'#" $ONOS_ROOT/bucklets/onos_app.bucklet