blob: d4aa64aae9818a607eeb39a98f472c194e0415c3 [file] [log] [blame]
tom6a9f2722014-09-13 17:00:02 -07001#!/bin/bash
2# ONOS developer BASH profile conveniences
3
4# Root of the ONOS source tree
5export ONOS_ROOT=${ONOS_ROOT:-~/onos-next}
6
7# Setup some environmental context for developers
8export JAVA_HOME=$(/usr/libexec/java_home)
9export MAVEN=${MAVEN:-~/Applications/apache-maven-3.2.2}
10export KARAF=${KARAF:-~/Applications/apache-karaf-3.0.1}
11export KARAF_LOG=$KARAF/data/log/karaf.log
12
13# Setup a path
14export PS=":"
15export PATH="$PATH:$ONOS_ROOT/tools/dev;$ONOS_ROOT/tools/package"
16export PATH="$PATH:$MAVEN/bin:$KARAF/bin"
17export PATH="$PATH:."
18
19# Convenience utility to warp to various ONOS source projects
20# e.g. 'o api', 'o dev', 'o'
21function o {
22 cd $(find $ONOS_ROOT/ -type d | egrep -v '.git|target|src' | \
23 egrep "${1:-$ONOS_ROOT}" | head -n 1)
24}
25
26# Short-hand for 'mvn clean install' for us lazy folk
27alias mci='mvn clean install'
28
29# Short-hand for ONOS build from the top of the source tree.
30alias ob='o && mvn clean install javadoc:aggregate'
31
32# Short-hand for tailing the ONOS (karaf) log
33alias tl='$ONOS_ROOT/tools/dev/watchLog'
34alias tlo='tl | grep --colour=always org.onlab'
35
36# Pretty-print JSON output
37alias pp='python -m json.tool'
38
39# Short-hand to launch API docs and sample topology viewer GUI
40alias docs='open $ONOS_ROOT/target/site/apidocs/index.html'
41alias gui='open http://localhost:8181/onos/tvue'