blob: dab369df740cd183c2cb4e0b2f206eac2d5ad4d2 [file] [log] [blame]
#!/bin/bash
# -----------------------------------------------------------------------------
# Builds a set of projects using ONOS archetypes.
# -----------------------------------------------------------------------------
function _usage () {
cat << _EOF_
usage:
$(basename $0)
summary:
Builds a set of projects using ONOS archetypes.
_EOF_
}
[ "$1" = "-h" ] && _usage && exit 0
set -e
export AROOT=${ONOS_STAGE_ROOT:-/tmp}/foo
export ARCHETYPE_OPTS="-DarchetypeGroupId=org.onosproject -DarchetypeVersion=2.2.7"
rm -fr $AROOT 2>/dev/null
mkdir -p $AROOT
# FIXME: for an in api bundle cli rest ui uitab uitopo ui2; do
for an in api bundle cli rest ui uitab uitopo; do
cd $AROOT
[ $an = api ] && name=foo-api || name=foo-app
mvn -q -B archetype:generate "$@" $ARCHETYPE_OPTS \
-DarchetypeArtifactId=onos-$an-archetype \
-DgroupId=org.foo -DartifactId=$name -Dversion=1.0 \
-Dpackage=org.foo.test -DinteractiveMode=false
cd $AROOT/$name
mvn "$@" -q -B clean install
done