mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-14 17:01:02 +02:00
- 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
47 lines
1.3 KiB
Bash
Executable File
47 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# -----------------------------------------------------------------------------
|
|
# Patches lib/BUCK file to use locally built YANG tools.
|
|
# -----------------------------------------------------------------------------
|
|
|
|
BVER=2.2.0-b3
|
|
SVER=2.2-SNAPSHOT
|
|
|
|
YANG_TOOLS_ROOT=~/onos-yang-tools
|
|
|
|
rm -f $ONOS_ROOT/lib/yang/* 2>/dev/null
|
|
mkdir -p $ONOS_ROOT/lib/yang
|
|
|
|
awk '
|
|
BEGIN { m = 0; y = 0; }
|
|
/^(remote_jar|prebuilt_jar)/ { s = $0; m = 1; next; }
|
|
{ if (m) { s = s "\n" $0; } else { print $0; } }
|
|
/onos-yang-.*('$BVER'|'$SVER')/ { y = 1; }
|
|
/^\)/ { if (m && !y) { print s; } y = 0; m = 0; }
|
|
' $ONOS_ROOT/lib/BUCK > /tmp/BUCK
|
|
mv /tmp/BUCK $ONOS_ROOT/lib/BUCK
|
|
|
|
for yl in $(egrep "onos-yang-.*$BVER" $ONOS_ROOT/lib/deps.json); do
|
|
n=$(echo $yl | cut -d\" -f2)
|
|
m=$(echo $yl | cut -d\" -f4)
|
|
m=${m/$BVER/$SVER}
|
|
j=$(find $YANG_TOOLS_ROOT -name $n-$SVER.jar)
|
|
s=yang/$(basename $j)
|
|
cp $j $ONOS_ROOT/lib/$s
|
|
|
|
# echo $n, $m, $j
|
|
|
|
cat <<EOF >>$ONOS_ROOT/lib/BUCK
|
|
prebuilt_jar (
|
|
name = '$n',
|
|
binary_jar = '$s',
|
|
maven_coords = '${m#mvn:*}',
|
|
visibility = [ 'PUBLIC' ],
|
|
)
|
|
|
|
EOF
|
|
done
|
|
|
|
# Patch the YANG BUCK plugin
|
|
cp $YANG_TOOLS_ROOT/compiler/plugin/buck/target/onos-yang-compiler-buck-plugin-$SVER.jar \
|
|
$ONOS_ROOT/bin/plugins/yang.jar
|