Integrating YANG live compilation into YANG runtime.

- Bumped ONOS dependency on ONOS YANG tools 2.2.0-b4.
- Added CLI to compile YANG models.
- Added GUI capability to compile YANG models via drag-n-drop or file upload.
- Fixed defect in propagating self-contained JAR apps through the cluster.

Change-Id: Icbd2a588bf1ffe0282e12d3d10a117e0957c3084
diff --git a/apps/yang/src/main/resources/onos-yang-jar b/apps/yang/src/main/resources/onos-yang-jar
new file mode 100644
index 0000000..4429e07
--- /dev/null
+++ b/apps/yang/src/main/resources/onos-yang-jar
@@ -0,0 +1,24 @@
+#!/bin/bash
+# -----------------------------------------------------------------------------
+# Assembles ONOS application jar from the compiled YANG model artifacts.
+# -----------------------------------------------------------------------------
+
+classes=${1:-classes}
+jar=${2:-model.jar}
+modelId=${3-org.onosproject.model.unknown}
+
+# Generate the app.xml descriptor file and stage it at the top of the jar
+sed "s/MODEL_ID/$modelId/g" $(dirname $0)/app.xml > $classes/app.xml
+
+# Generate features.xml file and stage it at the top of the jar
+sed "s/MODEL_ID/$modelId/g" $(dirname $0)/features.xml > $classes/features.xml
+mkdir -p $classes/m2/org/onosproject/$modelId/1.0/
+cp $classes/features.xml $classes/m2/org/onosproject/$modelId/1.0/$modelId-1.0-features.xml
+
+# Generate model self-registrator SCR descriptor
+mkdir -p $classes/OSGI-INF
+sed "s/PACKAGE/$modelId/g" $(dirname $0)/YangModelRegistrator.xml \
+    > $classes/OSGI-INF/$modelId.YangModelRegistrator.xml
+
+cd $classes
+jar cf $jar *
\ No newline at end of file