Thomas Vachuska | fc7f22d | 2014-12-04 11:07:01 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Builds a set of projects using ONOS archetypes. |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | |
Ayaka Koshibe | f17f34a | 2015-09-24 19:31:48 -0700 | [diff] [blame] | 6 | function _usage () { |
| 7 | cat << _EOF_ |
| 8 | usage: |
| 9 | $(basename $0) |
| 10 | |
| 11 | summary: |
| 12 | Builds a set of projects using ONOS archetypes. |
| 13 | |
| 14 | _EOF_ |
| 15 | } |
| 16 | |
| 17 | [ "$1" = "-h" ] && _usage && exit 0 |
| 18 | |
Brian O'Connor | 726dc5b | 2015-09-05 00:13:07 -0700 | [diff] [blame] | 19 | set -e |
| 20 | |
Thomas Vachuska | fc7f22d | 2014-12-04 11:07:01 -0800 | [diff] [blame] | 21 | export AROOT=/tmp/foo |
Brian O'Connor | f967ad6 | 2015-09-18 15:19:54 -0700 | [diff] [blame] | 22 | export ARCHETYPE_OPTS="-DarchetypeGroupId=org.onosproject -DarchetypeVersion=1.4.0-SNAPSHOT" |
Thomas Vachuska | fc7f22d | 2014-12-04 11:07:01 -0800 | [diff] [blame] | 23 | |
Thomas Vachuska | d9813e6 | 2015-01-21 08:43:04 -0800 | [diff] [blame] | 24 | mkdir -p $AROOT |
Thomas Vachuska | a2ae422 | 2015-04-29 18:42:09 -0700 | [diff] [blame] | 25 | for an in api bundle cli ui; do |
Thomas Vachuska | fc7f22d | 2014-12-04 11:07:01 -0800 | [diff] [blame] | 26 | cd $AROOT |
| 27 | rm -fr $AROOT/foo-$an |
| 28 | mvn archetype:generate $ARCHETYPE_OPTS \ |
| 29 | -DarchetypeArtifactId=onos-$an-archetype \ |
| 30 | -DgroupId=org.foo -DartifactId=foo-$an -Dversion=1.0 \ |
| 31 | -Dpackage=org.foo.$an -DinteractiveMode=false |
| 32 | cd $AROOT/foo-$an |
| 33 | mvn clean install |
| 34 | done |