blob: 7cb001c74e7978b8663d6bedfe018e7bddb4ab29 [file] [log] [blame]
Thomas Vachuskafc7f22d2014-12-04 11:07:01 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Builds a set of projects using ONOS archetypes.
4# -----------------------------------------------------------------------------
5
Ayaka Koshibef17f34a2015-09-24 19:31:48 -07006function _usage () {
7cat << _EOF_
8usage:
9 $(basename $0)
10
11summary:
12 Builds a set of projects using ONOS archetypes.
13
14_EOF_
15}
16
17[ "$1" = "-h" ] && _usage && exit 0
18
Brian O'Connor726dc5b2015-09-05 00:13:07 -070019set -e
20
HIGUCHI Yutafdfdb702016-02-25 11:18:22 -080021export AROOT=${ONOS_STAGE_ROOT:-/tmp}/foo
ONOS Jenkins User9d251072020-01-16 01:14:56 +000022export ARCHETYPE_OPTS="-DarchetypeGroupId=org.onosproject -DarchetypeVersion=2.2.1-SNAPSHOT"
Thomas Vachuskafc7f22d2014-12-04 11:07:01 -080023
Thomas Vachuskad9813e62015-01-21 08:43:04 -080024mkdir -p $AROOT
Sean Condona36f65c2019-05-20 08:21:41 +010025for an in api bundle cli rest ui ui2 uitab uitopo; do
Thomas Vachuskafc7f22d2014-12-04 11:07:01 -080026 cd $AROOT
27 rm -fr $AROOT/foo-$an
Ray Milkey548768f2019-07-02 15:01:56 -070028 mvn -q -B archetype:generate "$@" $ARCHETYPE_OPTS \
Thomas Vachuskafc7f22d2014-12-04 11:07:01 -080029 -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
Ray Milkey548768f2019-07-02 15:01:56 -070033 mvn "$@" -q -B clean install
Thomas Vachuskafc7f22d2014-12-04 11:07:01 -080034done