onos/models/openconfig/compile-yangs.sh
Yuta HIGUCHI 488a94c31e more error-prone issue fix
Change-Id: I49f2cc0459cfddddc6a99e2ebb8ad52d547e2909
2018-01-29 21:12:15 +00:00

22 lines
385 B
Bash
Executable File

#!/usr/bin/env bash
YANG_ROOT=$1
CONFDC_ARGS=' -c'
# YANGPATHS
for path in $(find $YANG_ROOT -type d); do
CONFDC_ARGS+=" --yangpath $path"
done
# create output dir
mkdir -p fxs
# compile .yang s
for yang in $(find $YANG_ROOT -type f -name '*.yang'); do
BASE=$(basename $yang)
OUT="${BASE%.yang}.fxs"
echo "Compiling..$yang"
confdc $CONFDC_ARGS -o fxs/$OUT -- $yang
done