Thomas Vachuska | 73436b5 | 2017-03-22 19:50:47 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Generates YANG Model registrator component. |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | |
| 6 | output=$1 |
| 7 | package=$2 |
| 8 | shift 2 |
| 9 | |
| 10 | aux=/tmp/yr-$$ |
| 11 | |
| 12 | trap "rm -fr $aux" EXIT |
| 13 | |
| 14 | pkgDir=$aux/${package//./\/} |
| 15 | rm -fr $aux $output |
| 16 | mkdir -p $pkgDir |
| 17 | cd $aux |
| 18 | |
| 19 | cat <<EOF >$output |
| 20 | // Auto-generated code |
| 21 | package $package; |
| 22 | |
| 23 | import org.onosproject.yang.AbstractYangModelRegistrator; |
| 24 | import org.apache.felix.scr.annotations.Component; |
| 25 | |
| 26 | @Component(immediate = true) |
| 27 | public class YangModelRegistrator extends AbstractYangModelRegistrator { |
| 28 | public YangModelRegistrator() { |
| 29 | super(YangModelRegistrator.class); |
| 30 | } |
| 31 | } |
| 32 | EOF |