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 |
Ray Milkey | 89dd53c | 2017-09-13 19:18:53 -0700 | [diff] [blame] | 22 | export ARCHETYPE_OPTS="-DarchetypeGroupId=org.onosproject -DarchetypeVersion=1.11.1-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 |
HIGUCHI Yuta | 9caa3a0 | 2016-01-09 23:17:54 -0800 | [diff] [blame] | 25 | for an in api bundle cli rest ui uitab uitopo; do |
Thomas Vachuska | fc7f22d | 2014-12-04 11:07:01 -0800 | [diff] [blame] | 26 | cd $AROOT |
| 27 | rm -fr $AROOT/foo-$an |
Brian O'Connor | 3e18147 | 2016-11-22 13:55:51 -0800 | [diff] [blame] | 28 | mvn archetype:generate $MVN_CLI_OPTS $ARCHETYPE_OPTS \ |
Thomas Vachuska | fc7f22d | 2014-12-04 11:07:01 -0800 | [diff] [blame] | 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 |
Brian O'Connor | 3e18147 | 2016-11-22 13:55:51 -0800 | [diff] [blame] | 33 | mvn $MVN_CLI_OPTS clean install |
Thomas Vachuska | fc7f22d | 2014-12-04 11:07:01 -0800 | [diff] [blame] | 34 | done |