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