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 | f7fa154 | 2020-01-27 21:44:01 +0000 | [diff] [blame] | 22 | export ARCHETYPE_OPTS="-DarchetypeGroupId=org.onosproject -DarchetypeVersion=2.3.1-SNAPSHOT" |
Thomas Vachuska | fc7f22d | 2014-12-04 11:07:01 -0800 | [diff] [blame] | 23 | |
Carmelo Cascone | 283cae8 | 2019-11-18 15:56:51 -0800 | [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 |
Carmelo Cascone | 283cae8 | 2019-11-18 15:56:51 -0800 | [diff] [blame] | 26 | |
Thomas Vachuska | e82b7aa | 2020-01-07 11:41:14 -0800 | [diff] [blame] | 27 | # FIXME: for an in api bundle cli rest ui uitab uitopo ui2; do |
| 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 |
Carmelo Cascone | 283cae8 | 2019-11-18 15:56:51 -0800 | [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 \ |
Carmelo Cascone | 283cae8 | 2019-11-18 15:56:51 -0800 | [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 |