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 | |
HIGUCHI Yuta | fdfdb70 | 2016-02-25 11:18:22 -0800 | [diff] [blame] | 21 | export AROOT=${ONOS_STAGE_ROOT:-/tmp}/foo |
ONOS Jenkins User | 39597db | 2020-03-25 17:26:34 +0000 | [diff] [blame] | 22 | export ARCHETYPE_OPTS="-DarchetypeGroupId=org.onosproject -DarchetypeVersion=2.2.2" |
Thomas Vachuska | fc7f22d | 2014-12-04 11:07:01 -0800 | [diff] [blame] | 23 | |
Ray Milkey | 670513d | 2020-03-24 14:04:21 -0700 | [diff] [blame] | 24 | rm -fr $AROOT 2>/dev/null |
Thomas Vachuska | d9813e6 | 2015-01-21 08:43:04 -0800 | [diff] [blame] | 25 | mkdir -p $AROOT |
Ray Milkey | 670513d | 2020-03-24 14:04:21 -0700 | [diff] [blame] | 26 | |
Thomas Vachuska | a659f3d | 2020-03-23 16:17:06 -0700 | [diff] [blame] | 27 | # FIXME: for an in api bundle cli rest ui uitab uitopo ui2; do |
Thomas Vachuska | b12adea | 2020-03-23 14:01:17 -0700 | [diff] [blame] | 28 | for an in api bundle cli rest ui uitab uitopo; do |
Thomas Vachuska | fc7f22d | 2014-12-04 11:07:01 -0800 | [diff] [blame] | 29 | cd $AROOT |
Ray Milkey | 670513d | 2020-03-24 14:04:21 -0700 | [diff] [blame] | 30 | [ $an = api ] && name=foo-api || name=foo-app |
Ray Milkey | 548768f | 2019-07-02 15:01:56 -0700 | [diff] [blame] | 31 | mvn -q -B archetype:generate "$@" $ARCHETYPE_OPTS \ |
Thomas Vachuska | fc7f22d | 2014-12-04 11:07:01 -0800 | [diff] [blame] | 32 | -DarchetypeArtifactId=onos-$an-archetype \ |
Ray Milkey | 670513d | 2020-03-24 14:04:21 -0700 | [diff] [blame] | 33 | -DgroupId=org.foo -DartifactId=$name -Dversion=1.0 \ |
| 34 | -Dpackage=org.foo.test -DinteractiveMode=false |
| 35 | cd $AROOT/$name |
Ray Milkey | 548768f | 2019-07-02 15:01:56 -0700 | [diff] [blame] | 36 | mvn "$@" -q -B clean install |
Thomas Vachuska | fc7f22d | 2014-12-04 11:07:01 -0800 | [diff] [blame] | 37 | done |