Committed by
Gerrit Code Review
Moved some dev tools from test/bin to dev/bin.
Added onos-create-app as a convenience. Change-Id: Ide9b9801a0a1d2229a153b85e23766f6018a8267
Showing
5 changed files
with
26 additions
and
0 deletions
tools/dev/bin/onos-create-app
0 → 100755
1 | +#!/bin/bash | ||
2 | +# ----------------------------------------------------------------------------- | ||
3 | +# Tool to create an application from scratch using ONOS Maven archetypes. | ||
4 | +# ----------------------------------------------------------------------------- | ||
5 | + | ||
6 | +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 | ||
7 | +. $ONOS_ROOT/tools/build/envDefaults | ||
8 | + | ||
9 | +type=${1:-bundle} | ||
10 | + | ||
11 | +if [ "$1" = "-?" -o "$1" = "-h" -o "$1" = "--help" ]; then | ||
12 | + echo "usage: $(basename $0) {bundle|ui|cli|api} groupId artifactId version package mvn-options" | ||
13 | + echo " All arguments are optional" | ||
14 | + exit 1 | ||
15 | +fi | ||
16 | + | ||
17 | +otherOptions="" | ||
18 | +[ -n "$1" ] && shift | ||
19 | +[ -n "$1" ] && otherOptions="$otherOptions -DgroupId=$1" && shift | ||
20 | +[ -n "$1" ] && otherOptions="$otherOptions -DartifactId=$1" && shift | ||
21 | +[ -n "$1" ] && otherOptions="$otherOptions -Dversion=$1" && shift | ||
22 | +[ -n "$1" ] && otherOptions="$otherOptions -Dpackage=$1" && shift | ||
23 | + | ||
24 | +mvn archetype:generate -DarchetypeGroupId=org.onosproject \ | ||
25 | + -DarchetypeArtifactId=onos-$type-archetype -DarchetypeVersion=$ONOS_POM_VERSION \ | ||
26 | + $otherOptions "$@" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment