From 6a9f272e82b89edac5384b4595ecb49284f22128 Mon Sep 17 00:00:00 2001 From: tom Date: Sat, 13 Sep 2014 17:00:02 -0700 Subject: [PATCH] Added tools/dev/bash_profile with developer conveniences --- tools/dev/bash_profile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 tools/dev/bash_profile diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile new file mode 100644 index 0000000000..d4aa64aae9 --- /dev/null +++ b/tools/dev/bash_profile @@ -0,0 +1,41 @@ +#!/bin/bash +# ONOS developer BASH profile conveniences + +# Root of the ONOS source tree +export ONOS_ROOT=${ONOS_ROOT:-~/onos-next} + +# Setup some environmental context for developers +export JAVA_HOME=$(/usr/libexec/java_home) +export MAVEN=${MAVEN:-~/Applications/apache-maven-3.2.2} +export KARAF=${KARAF:-~/Applications/apache-karaf-3.0.1} +export KARAF_LOG=$KARAF/data/log/karaf.log + +# Setup a path +export PS=":" +export PATH="$PATH:$ONOS_ROOT/tools/dev;$ONOS_ROOT/tools/package" +export PATH="$PATH:$MAVEN/bin:$KARAF/bin" +export PATH="$PATH:." + +# Convenience utility to warp to various ONOS source projects +# e.g. 'o api', 'o dev', 'o' +function o { + cd $(find $ONOS_ROOT/ -type d | egrep -v '.git|target|src' | \ + egrep "${1:-$ONOS_ROOT}" | head -n 1) +} + +# Short-hand for 'mvn clean install' for us lazy folk +alias mci='mvn clean install' + +# Short-hand for ONOS build from the top of the source tree. +alias ob='o && mvn clean install javadoc:aggregate' + +# Short-hand for tailing the ONOS (karaf) log +alias tl='$ONOS_ROOT/tools/dev/watchLog' +alias tlo='tl | grep --colour=always org.onlab' + +# Pretty-print JSON output +alias pp='python -m json.tool' + +# Short-hand to launch API docs and sample topology viewer GUI +alias docs='open $ONOS_ROOT/target/site/apidocs/index.html' +alias gui='open http://localhost:8181/onos/tvue'