diff options
Diffstat (limited to 'framework/src/onos/tools/dev')
17 files changed, 1035 insertions, 0 deletions
diff --git a/framework/src/onos/tools/dev/bash_profile b/framework/src/onos/tools/dev/bash_profile new file mode 100644 index 00000000..5e161ccd --- /dev/null +++ b/framework/src/onos/tools/dev/bash_profile @@ -0,0 +1,189 @@ +#!/bin/bash +# ONOS developer BASH profile conveniences +# Simply include in your own .bash_aliases or .bash_profile + +# Root of the ONOS source tree +export ONOS_ROOT=${ONOS_ROOT:-~/onos} + +# Setup some environmental context for developers +if [ -z "${JAVA_HOME}" ]; then + if [ -x /usr/libexec/java_home ]; then + export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) + elif [ -d /usr/lib/jvm/java-8-oracle ]; then + export JAVA_HOME="/usr/lib/jvm/java-8-oracle" + elif [ -d /usr/lib/jvm/java-8-openjdk-amd64 ]; then + export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64" + fi +fi + +export MAVEN=${MAVEN:-~/Applications/apache-maven-3.3.1} + +export KARAF_VERSION=${KARAF_VERSION:-3.0.3} +export KARAF_ROOT=${KARAF_ROOT:-~/Applications/apache-karaf-$KARAF_VERSION} +export KARAF_LOG=$KARAF_ROOT/data/log/karaf.log + +# Setup a path +export PATH="$PATH:$ONOS_ROOT/tools/dev/bin" +export PATH="$PATH:$ONOS_ROOT/tools/test/bin:$ONOS_ROOT/tools/test/scenarios/bin" +export PATH="$PATH:$ONOS_ROOT/tools/build" +export PATH="$PATH:$MAVEN/bin:$KARAF_ROOT/bin" + +# Setup cell enviroment +export ONOS_CELL=${ONOS_CELL:-local} + +# Setup default web user/password +export ONOS_WEB_USER=onos +export ONOS_WEB_PASS=rocks + +# Setup default location of test scenarios +export ONOS_SCENARIOS=$ONOS_ROOT/tools/test/scenarios + +# 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|gen-src' | \ + egrep "${1:-$ONOS_ROOT}" | egrep -v "$ONOS_ROOT/.+/src/" | head -n 1) +} + +# Short-hand for 'mvn clean install' for us lazy folk +alias mci='mvn clean install' +alias mcis='mvn clean install -DskipTests -Dcheckstyle.skip -U -T 1C' +alias mis='mvn install -DskipTests -Dcheckstyle.skip -U -T 1C' + +# Short-hand for ONOS build, package and test. +alias ob='onos-build' +alias obi='onos-build -Dmaven.test.failure.ignore=true' +alias obs='onos-build-selective' +alias obd='onos-build-docs' +alias op='onos-package' +alias ok='onos-karaf' +alias ot='onos-test' +alias ol='onos-log' +alias ow='onos-watch' +alias ocl='onos-check-logs' +alias oi='setPrimaryInstance' +alias pub='onos-push-update-bundle' + +# Short-hand for tailing and searching the ONOS (karaf) log +alias tl='$ONOS_ROOT/tools/dev/bin/onos-local-log' +alias ll='less $KARAF_LOG' +alias gl='grep $KARAF_LOG --colour=auto -E -e ' + +function filterLocalLog { + tl | grep --colour=always -E -e "${1-org.onlab|org.onosproject}" +} +alias tlo='filterLocalLog' +alias tle='tlo "ERROR|WARN|Exception|Error"' + +function filterLog { + ol | grep --colour=always -E -e "${1-org.onlab|org.onosproject}" +} +alias olo='filterLog' +alias ole='olo "ERROR|WARN|Exception|Error"' + +# Pretty-print JSON output +alias pp='python -m json.tool' + +# Short-hand to launch Java API docs, REST API docs and ONOS GUI +alias docs='open $ONOS_ROOT/docs/target/site/apidocs/index.html' +alias rsdocs='onos-rsdocs' +alias gui='onos-gui' + + +# Test related conveniences + +# SSH to a specified ONOS instance +alias sshctl='onos-ssh' +alias sshnet='onos-ssh $OCN' + + +# Sets the primary instance to the specified instance number. +function setPrimaryInstance { + export OCI=$(env | egrep "OC[0-9]+" | sort | egrep OC${1:-1} | cut -d= -f2) + echo $OCI +} + +# Applies the settings in the specified cell file or lists current cell definition +# if no cell file is given. +function cell { + if [ -n "$1" ]; then + [ ! -f $ONOS_ROOT/tools/test/cells/$1 ] && \ + echo "No such cell: $1" >&2 && return 1 + unset ONOS_CELL ONOS_NIC ONOS_IP ONOS_APPS ONOS_BOOT_FEATURES + unset OCI OCN OCT ONOS_INSTANCES ONOS_USER ONOS_GROUP ONOS_FEATURES + unset $(env | sed -n 's:\(^OC[0-9]\{1,\}\)=.*:\1 :g p') + export ONOS_WEB_USER=onos + export ONOS_WEB_PASS=rocks + export ONOS_CELL=$1 + . $ONOS_ROOT/tools/test/cells/$1 + export ONOS_INSTANCES=$(env | grep 'OC[0-9]*=' | sort | cut -d= -f2) + setPrimaryInstance 1 >/dev/null + cell + else + env | egrep "ONOS_CELL" + env | egrep "OCI" + env | egrep "OC[0-9]+" | sort + env | egrep "OC[NT]" + env | egrep "ONOS_" | egrep -v 'ONOS_ROOT|ONOS_CELL|ONOS_INSTANCES' | sort + fi +} + +cell $ONOS_CELL > /dev/null + +# Lists available cells +function cells { + for cell in $(ls -1 $ONOS_ROOT/tools/test/cells); do + printf "%-16s %s\n" \ + "$([ $cell = $ONOS_CELL ] && echo $cell '*' || echo $cell)" \ + "$(grep '^#' $ONOS_ROOT/tools/test/cells/$cell | head -n 1)" + done +} + +# Miscellaneous +function spy { + ps -ef | egrep "$@" | grep -v egrep +} + +function nuke { + spy "$@" | cut -c7-11 | xargs kill +} + +# Edit a cell file by providing a cell name. Opens the cell file in $EDITOR. +function vicell() { + local apply=false + local create=false + local cdf="" + local cpath="${ONOS_ROOT}/tools/test/cells/" + + if [ -z "$1" ] || [ "$1" = "-h" ] ; then + printf "usage: vicell [file] [options]\n\noptions:\n" + printf "\t-a: apply the cell after editing\n" + printf "\t-e: [editor] set EDITOR to [editor] (default *vi*)\n" + printf "\t-c: create cell file if none exist\n\n" + return 1 + fi + + while [ $# -gt 0 ]; do + case "$1" in + -a) apply=true ;; + -e) EDITOR=$2; shift ;; + -c) create=true ;; + *) cdf="$1" ;; + esac + shift + done + + if [ ! -e "${cpath}${cdf}" ] && [ "$create" = "false" ]; then + printf "${cdf} : no such cell\n" && return 1 + fi + + if [ -z "${EDITOR}" ] || [ -x "$(which ${EDITOR})" ]; then + unset EDITOR && vi ${cpath}${cdf} + else + $EDITOR ${cpath}${cdf} + fi + ($apply) && cell ${cdf} +} + +# autocomplete for certain utilities +. ${ONOS_ROOT}/tools/test/bin/ogroup-opts diff --git a/framework/src/onos/tools/dev/bin/clean-branches.py b/framework/src/onos/tools/dev/bin/clean-branches.py new file mode 100755 index 00000000..3de7cb70 --- /dev/null +++ b/framework/src/onos/tools/dev/bin/clean-branches.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python + +from subprocess import check_output +import sys + +def get_merged_branches_by_change_id(): + '''a list of merged branches, by change id excluding support branches and master''' + raw_changeIds = check_output('git log origin/master | grep -i change-id | awk {\' print $2 \'}', shell=True) + changeIds = [b.strip() for b in raw_changeIds.split('\n') if b.strip()] + raw_branches = check_output('git branch -a', shell=True) + branches = [b.strip() for b in raw_branches.split('\n') + if b.strip() and not b.startswith('*') and \ + not b.strip().startswith('onos') and not b.strip().startswith('remotes') and b.strip() != 'master'] + to_delete = [] + for branch in branches: + raw_local_change_ids = check_output('git show %s | grep -i change-id | awk {\' print $2 \'}' % branch, shell=True) + local_change_ids = [ b.strip() for b in raw_local_change_ids.split('\n') if b.strip() ] + for local_change_id in local_change_ids: + if local_change_id in changeIds and branch not in to_delete: + to_delete.append(branch) + + return to_delete + + +def delete_branch(branch): + return check_output('git branch -D %s' % branch, shell=True).strip() + + +if __name__ == '__main__': + dry_run = '--confirm' not in sys.argv + one_by_one = '--one-by-one' in sys.argv + to_delete = get_merged_branches_by_change_id() + if len(to_delete) == 0: + print "Nothing to clean" + sys.exit(0) + for branch in to_delete: + if dry_run: + print branch + else: + if one_by_one: + print 'Do you want to delete branch %s [y/N]' % branch + ans = raw_input() + if ans == 'y' or ans == 'Y': + print delete_branch(branch) + else: + print delete_branch(branch) + + if dry_run: + print '*****************************************************************' + print 'Did not actually delete anything yet, pass in --confirm to delete' + print diff --git a/framework/src/onos/tools/dev/bin/onos-app b/framework/src/onos/tools/dev/bin/onos-app new file mode 100755 index 00000000..d6fe562b --- /dev/null +++ b/framework/src/onos/tools/dev/bin/onos-app @@ -0,0 +1,72 @@ +#!/bin/bash +# ----------------------------------------------------------------------------- +# Tool to manage ONOS applications using REST API. +# ----------------------------------------------------------------------------- + +node=${1:-$OCI} +cmd=${2:-list} +app=${3} + +export URL=http://$node:8181/onos/v1/applications +export HDR="-HContent-Type:application/octet-stream" +export curl="curl -sS --user $ONOS_WEB_USER:$ONOS_WEB_PASS" + +# Prints usage help +function usage { + echo "usage: onos-app <node-ip> list" >&2 + echo " onos-app <node-ip> {install|install!} <app-file>" >&2 + echo " onos-app <node-ip> {reinstall|reinstall!} [<app-name>] <app-file>" >&2 + echo " onos-app <node-ip> {activate|deactivate|uninstall} <app-name>" >&2 + exit 1 +} + +# Extract app name from the specified *.oar file +function appName { + aux=/tmp/aux$$.jar + cp $1 $aux + pushd /tmp >/dev/null + jar xf $aux app.xml && grep name= app.xml | cut -d\" -f2 + rm -f $aux /tmp/app.xml + popd >/dev/null +} + +[ -z $node -o "$node" = "-h" -o "$node" = "--help" -o "$node" = "-?" ] && usage + +case $cmd in + list) $curl -X GET $URL;; + install!|install) + [ $cmd = "install!" ] && activate="?activate=true" + [ $# -lt 3 -o ! -f $app ] && usage + $curl -X POST $HDR $URL$activate --data-binary @$app + ;; + + reinstall!|reinstall) + [ $cmd = "reinstall!" ] && activate="?activate=true" + [ $# -lt 4 -a ! -f "$3" ] && usage + [ $# -eq 4 -a ! -f "$4" ] && usage + oar=$4 + [ $# -lt 4 ] && oar=$3 && app=$(appName $oar) + $curl -X DELETE $URL/$app + $curl -X POST $HDR $URL$activate --data-binary @$oar + ;; + + uninstall) + [ $# -lt 3 ] && usage + $curl -X DELETE $URL/$app + ;; + activate) + [ $# -lt 3 ] && usage + $curl -X POST $URL/$app/active + ;; + deactivate) + [ $# -lt 3 ] && usage + $curl -X DELETE $URL/$app/active + ;; + + *) usage;; +esac + + +status=$? +echo # new line for prompt +exit $status diff --git a/framework/src/onos/tools/dev/bin/onos-build-selective b/framework/src/onos/tools/dev/bin/onos-build-selective new file mode 100755 index 00000000..ac2dec8e --- /dev/null +++ b/framework/src/onos/tools/dev/bin/onos-build-selective @@ -0,0 +1,44 @@ +#!/bin/bash +# ---------------------------------------------------------------------------- +# Selectively builds only those projects that contained modified Java files. +# ---------------------------------------------------------------------------- + +cd $ONOS_ROOT + +projects=$(find $ONOS_ROOT -type f -path '*/src/*' \ + -exec $ONOS_ROOT/tools/dev/bin/onos-build-selective-hook {} \; | \ + grep -v -f $ONOS_ROOT/tools/dev/bin/onos-build-selective.exclude | \ + sort -u | sed "s:$ONOS_ROOT::g" | tr '\n' ',' | \ + sed 's:/,:,:g;s:,/:,:g;s:^/::g;s:,$::g') + +if [ -n "$projects" ]; then + # Ascertain artifact IDs of the projects to be rebuilt + modulesERE="" + for pd in ${projects//,/ }; do + artifactId=$(grep -E "^ <artifactId>.*</artifactId>$" ${pd}/pom.xml | \ + sed 's/.[^>]*>//;s/<.*//') + modulesERE="$modulesERE|$artifactId" + done + modulesERE=${modulesERE#|*} + + # Search through staged app.xml files for any apps that require one or + # more of the modified artifacts. + appProjects=$(find $ONOS_ROOT -type f -path '*/target/oar/app.xml' | \ + xargs grep '<artifact>' | grep -E "/($modulesERE)/" | \ + cut -d: -f1 | sed 's:/target/oar/.*::g' | \ + sort -u | sed "s:$ONOS_ROOT::g" | tr '\n' ',' | \ + sed 's:/,:,:g;s:,/:,:g;s:^/::g;s:,$::g') + + # If we found any, append those app projects to the list of projects to + # be built. + [ -n "$appProjects" ] && projects=$projects,$appProjects + + echo Building projects $projects + cd $ONOS_ROOT && mvn --projects $projects ${@:-clean install} + status=$? + + [ -n "$appProjects" ] && echo "App staging required for projects $appProjects" + exit $status +else + exit 0 +fi diff --git a/framework/src/onos/tools/dev/bin/onos-build-selective-hook b/framework/src/onos/tools/dev/bin/onos-build-selective-hook new file mode 100755 index 00000000..fbe77522 --- /dev/null +++ b/framework/src/onos/tools/dev/bin/onos-build-selective-hook @@ -0,0 +1,10 @@ +#!/bin/bash +# ---------------------------------------------------------------------------- +# Echoes project-level directory if a source file within is newer than the +# target directory. +# ---------------------------------------------------------------------------- + +[ ${1/*\//} = "package-info.java" ] && exit 0 + +project=${1/src*/} +[ ${project}target -nt $1 ] || echo ${project} diff --git a/framework/src/onos/tools/dev/bin/onos-build-selective.exclude b/framework/src/onos/tools/dev/bin/onos-build-selective.exclude new file mode 100644 index 00000000..1265494e --- /dev/null +++ b/framework/src/onos/tools/dev/bin/onos-build-selective.exclude @@ -0,0 +1,9 @@ +.*/archetypes/.* +.*/maven-plugin/.* +.*/build/conf/.* +.*/docs/.* +.*/openflow/drivers/.* +.*/cord-gui/.* +.*/jdvue/.* +.*/ovsdb/api/.* +.*/netconf/flow/.*
\ No newline at end of file diff --git a/framework/src/onos/tools/dev/bin/onos-create-app b/framework/src/onos/tools/dev/bin/onos-create-app new file mode 100755 index 00000000..65b00b65 --- /dev/null +++ b/framework/src/onos/tools/dev/bin/onos-create-app @@ -0,0 +1,42 @@ +#!/bin/bash +# ----------------------------------------------------------------------------- +# Tool to create an application from scratch using ONOS Maven archetypes. +# ----------------------------------------------------------------------------- + +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 +. $ONOS_ROOT/tools/build/envDefaults + +type=${1:-bundle} + +[ $type = app ] && archetype=bundle || archetype=$type + +if [ "$1" = "-?" -o "$1" = "-h" -o "$1" = "--help" ]; then + echo "usage: $(basename $0) {app|bundle|ui|cli|api} groupId artifactId version package mvn-options" + echo " All arguments are optional" + exit 1 +fi + +otherOptions="" +[ -n "$1" ] && shift +[ -n "$1" ] && otherOptions="$otherOptions -DgroupId=$1" && shift +[ -n "$1" ] && otherOptions="$otherOptions -DartifactId=$1" && dir=$1 && shift +[ -n "$1" ] && otherOptions="$otherOptions -Dversion=$1" && shift +[ -n "$1" ] && otherOptions="$otherOptions -Dpackage=$1" && shift + +mvn archetype:generate -DarchetypeGroupId=org.onosproject \ + -DarchetypeArtifactId=onos-$archetype-archetype \ + -DarchetypeVersion=$ONOS_POM_VERSION $otherOptions "$@" + +# Patch the pom.xml file to make this an app. +if [ $type = app ]; then + # We need to add a few lines to the pom.xml to make this an app + if [ -n "$dir" ] && [ -d $dir ]; then + egrep -v " (<!--|-->)" $dir/pom.xml > $dir/pom.app.xml + mv $dir/pom.app.xml $dir/pom.xml + else + echo + echo "IMPORTANT:" + echo "To build the application, you need to uncomment the 'onos.app.name' and 'onos.app.origin' properties in the pom.xml" + echo + fi +fi diff --git a/framework/src/onos/tools/dev/bin/onos-karaf b/framework/src/onos/tools/dev/bin/onos-karaf new file mode 100755 index 00000000..9c575fb4 --- /dev/null +++ b/framework/src/onos/tools/dev/bin/onos-karaf @@ -0,0 +1,7 @@ +#!/bin/bash +# ----------------------------------------------------------------------------- +# Makes sure local ONOS karaf instance is primed & staged and then launches +# karaf using the supplied arguments. +# ----------------------------------------------------------------------------- + +onos-setup-karaf && karaf "$@"
\ No newline at end of file diff --git a/framework/src/onos/tools/dev/bin/onos-local-log b/framework/src/onos/tools/dev/bin/onos-local-log new file mode 100755 index 00000000..a17d3b9c --- /dev/null +++ b/framework/src/onos/tools/dev/bin/onos-local-log @@ -0,0 +1,10 @@ +#!/bin/bash +# ---------------------------------------------------------------------------- +# Continuously watches the Apache Karaf log; survives 'karaf clean' +# ---------------------------------------------------------------------------- +KARAF_LOG=${KARAF_LOG:-~/apache-karaf-$KARAF_VERSION/data/log/karaf.log} + +while true; do + [ ! -f $KARAF_LOG ] && sleep 2 && continue + tail -n 512 -f -F $KARAF_LOG +done diff --git a/framework/src/onos/tools/dev/bin/onos-setup-karaf b/framework/src/onos/tools/dev/bin/onos-setup-karaf new file mode 100755 index 00000000..3323d9d1 --- /dev/null +++ b/framework/src/onos/tools/dev/bin/onos-setup-karaf @@ -0,0 +1,123 @@ +#!/bin/bash +# ----------------------------------------------------------------------------- +# Downloads and sets-up Apache Karaf as a basis for running ONOS locally +# as a single-instance. +# +# Note that this in no way impacts the method for running ONOS remotely. +# For that, one should use onos-package and onos-install tools. +# ----------------------------------------------------------------------------- + +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 +. $ONOS_ROOT/tools/build/envDefaults + +# TODO: consider putting this under ~/Applications/onos/apache-karaf-... +export KARAF_ROOT=${KARAF_ROOT:-~/Applications/apache-karaf-$KARAF_VERSION} +export STAGE=$(dirname $KARAF_ROOT) + +# Validates the specified IP regular expression against existing adapters. +# Excludes local-loopback. +function validateIp { + ifconfig | awk '{ print $2}' | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | grep $1 +} + +# Clean the previous Karaf directory if requested and if it exists. +if [ "$1" = "clean" ]; then + shift + CLEAN="true" + [ -d $KARAF_ROOT ] && rm -fr $KARAF_ROOT $STAGE/apps $STAGE/config +fi + +ONOS_IP=${ONOS_IP:-127.0.0.1} +IP="${1:-$ONOS_IP}" + +# If IP was not given, nor configured attempt to use ONOS_NIC env. variable +if [ -z "$IP" -a -n "$ONOS_NIC" ]; then + IP=$(validateIp $ONOS_NIC) + [ -z "$IP" ] && echo "No adapter with IP matching $ONOS_NIC found!" +else + # Otherwise, verify that the IP address given exists among the adapters. + saveIp=$IP + IP=$(validateIp $IP) + [ -z "$IP" ] && echo "No adapter with IP $saveIp found!" +fi + +# If IP is still not surmised or if usage was requested, show usage and IPs. +if [ -z "$IP" -o "$1" = "-?" -o "$1" = "-h" -o "$1" = "--help" ]; then + echo "usage: $(basename $0) [clean] <ip-address>" + echo "Available IP addresses are:" + validateIp . + exit 1 +fi + +SUBNET="$(echo $IP | cut -d. -f1-3)" + +# Bail on any errors +set -e + +# Check if Apache Karaf is already installed. +if [ ! -d $KARAF_ROOT ]; then + # Check if Apache Karaf bits are available and if not, fetch them. + if [ ! -f $KARAF_TAR ]; then + echo "Downloading $KARAF_TAR..." + curl -sL http://downloads.onosproject.org/third-party/apache-karaf-$KARAF_VERSION.tar.gz > $KARAF_TAR + fi + [ ! -f $KARAF_ZIP -a ! -f $KARAF_TAR ] && \ + echo "Apache Karaf bits $KARAF_ZIP or $KARAF_TAR not found" && exit 1 + + echo "Unpacking $KARAF_TAR to $STAGE..." + mkdir -p $STAGE + cd $STAGE + tar zxf $KARAF_TAR + rm -rf $KARAF_ROOT/demos +fi + +if ! grep -q "/onos-features/" $KARAF_ROOT/etc/org.apache.karaf.features.cfg; then + # Patch the Apache Karaf distribution file to add ONOS features repository + echo "Adding ONOS feature repository..." + perl -pi.old -e "s|^(featuresRepositories=.*)|\1,mvn:org.onosproject/onos-features/$ONOS_POM_VERSION/xml/features|" \ + $KARAF_ROOT/etc/org.apache.karaf.features.cfg +fi + +if ! grep -q ",onos-api," $KARAF_ROOT/etc/org.apache.karaf.features.cfg; then + # Patch the Apache Karaf distribution file to load default ONOS boot features + export BOOT_FEATURES="webconsole,onos-api,onos-core,onos-incubator,onos-cli,onos-rest,onos-gui" + echo "Adding ONOS boot features $BOOT_FEATURES..." + perl -pi.old -e "s|^(featuresBoot=.*)|\1,$BOOT_FEATURES|" \ + $KARAF_ROOT/etc/org.apache.karaf.features.cfg +fi + +if [ ! -f $KARAF_ROOT/lib/onos-branding-$ONOS_POM_VERSION.jar ]; then + # Patch the Apache Karaf distribution with ONOS branding bundle + echo "Branding as ONOS..." + rm -f $KARAF_ROOT/lib/onos-branding-*.jar + cp $M2_REPO/org/onosproject/onos-branding/$ONOS_POM_VERSION/onos-branding-$ONOS_POM_VERSION.jar \ + $KARAF_ROOT/lib +fi + +echo "Creating local cluster configs for IP $IP..." +[ -d $STAGE/config ] || mkdir -p $STAGE/config +cat > $STAGE/config/cluster.json <<EOF + { "ipPrefix": "$SUBNET.*", + "nodes":[ { "id": "$IP", "ip": "$IP", "tcpPort": 9876 }]} +EOF + +cat > $STAGE/config/tablets.json <<EOF + { "nodes": [ { "ip": "$IP", "id": "$IP", "tcpPort": 9876 }], + "partitions": { "p1": [ { "ip": "$IP", "id": "$IP", "tcpPort": 9876 }]}} +EOF + +if [ "$CLEAN" = "true" ]; then + echo "Copying package configs..." + cp -r $ONOS_ROOT/tools/package/etc/* $KARAF_ROOT/etc/ + cp -r $ONOS_ROOT/tools/package/config/* $STAGE/config/ +fi + +echo "Staging builtin apps..." +rm -fr $STAGE/apps +onos-stage-apps $STAGE/apps $KARAF_ROOT/system + +ACTIVE_APPS=${ONOS_APPS:-drivers,openflow} +echo "Customizing apps to be auto-activated: $ACTIVE_APPS..." +for app in ${ACTIVE_APPS//,/ }; do + touch $STAGE/apps/org.onosproject.$app/active +done diff --git a/framework/src/onos/tools/dev/bin/onos-setup-ubuntu-devenv b/framework/src/onos/tools/dev/bin/onos-setup-ubuntu-devenv new file mode 100755 index 00000000..d528c6b2 --- /dev/null +++ b/framework/src/onos/tools/dev/bin/onos-setup-ubuntu-devenv @@ -0,0 +1,21 @@ +#!/bin/bash +# +# Script to install ONOS dependencies on Ubuntu 14.04 +# + +echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections + +echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections + +sudo apt-get install software-properties-common -y +sudo add-apt-repository ppa:webupd8team/java -y +sudo apt-get update && sudo apt-get install oracle-java8-installer oracle-java8-set-default git wget -y +export JAVA_HOME=/usr/lib/jvm/java-8-oracle + +cd; mkdir Downloads Applications +cd Downloads +wget http://download.nextag.com/apache/karaf/3.0.3/apache-karaf-3.0.3.tar.gz +wget http://archive.apache.org/dist/maven/maven-3/3.3.1/binaries/apache-maven-3.3.1-bin.tar.gz +tar -zxvf apache-karaf-3.0.3.tar.gz -C ../Applications/ +tar -zxvf apache-maven-3.3.1-bin.tar.gz -C ../Applications/ + diff --git a/framework/src/onos/tools/dev/bin/onos-update-bundle b/framework/src/onos/tools/dev/bin/onos-update-bundle new file mode 100755 index 00000000..9e9e08bb --- /dev/null +++ b/framework/src/onos/tools/dev/bin/onos-update-bundle @@ -0,0 +1,16 @@ +#!/bin/bash +# ----------------------------------------------------------------------------- +# Update bundle on locally running karaf. +# ----------------------------------------------------------------------------- + +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 +. $ONOS_ROOT/tools/build/envDefaults + +cd ~/.m2/repository +jar=$(find org/onosproject -type f -name '*.jar' | grep -e $1 | grep -v -e -tests | head -n 1) + +[ -z "$jar" ] && echo "No bundle $1 found for" && exit 1 + +bundle=$(echo $(basename $jar .jar) | sed 's/-[0-9].*//g') + +client "bundle:update -f $bundle" 2>/dev/null diff --git a/framework/src/onos/tools/dev/eclipse-cleanup.xml b/framework/src/onos/tools/dev/eclipse-cleanup.xml new file mode 100644 index 00000000..ee0f302d --- /dev/null +++ b/framework/src/onos/tools/dev/eclipse-cleanup.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- + ~ Copyright 2014 Open Networking Laboratory + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> +<profiles version="2"> +<profile kind="CleanUpProfile" name="ONOS Clean Up" version="2"> +<setting id="cleanup.remove_redundant_type_arguments" value="true"/> +<setting id="cleanup.remove_unused_private_fields" value="true"/> +<setting id="cleanup.always_use_parentheses_in_expressions" value="false"/> +<setting id="cleanup.never_use_blocks" value="false"/> +<setting id="cleanup.remove_unused_private_methods" value="true"/> +<setting id="cleanup.add_missing_deprecated_annotations" value="true"/> +<setting id="cleanup.convert_to_enhanced_for_loop" value="false"/> +<setting id="cleanup.remove_unnecessary_nls_tags" value="true"/> +<setting id="cleanup.sort_members" value="false"/> +<setting id="cleanup.remove_unused_local_variables" value="false"/> +<setting id="cleanup.never_use_parentheses_in_expressions" value="true"/> +<setting id="cleanup.remove_unused_private_members" value="false"/> +<setting id="cleanup.remove_unnecessary_casts" value="true"/> +<setting id="cleanup.make_parameters_final" value="false"/> +<setting id="cleanup.use_this_for_non_static_field_access" value="false"/> +<setting id="cleanup.remove_private_constructors" value="true"/> +<setting id="cleanup.use_blocks" value="false"/> +<setting id="cleanup.always_use_this_for_non_static_method_access" value="false"/> +<setting id="cleanup.remove_trailing_whitespaces_all" value="true"/> +<setting id="cleanup.always_use_this_for_non_static_field_access" value="false"/> +<setting id="cleanup.use_this_for_non_static_field_access_only_if_necessary" value="true"/> +<setting id="cleanup.add_default_serial_version_id" value="true"/> +<setting id="cleanup.make_type_abstract_if_missing_method" value="false"/> +<setting id="cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class" value="true"/> +<setting id="cleanup.make_variable_declarations_final" value="false"/> +<setting id="cleanup.add_missing_nls_tags" value="false"/> +<setting id="cleanup.format_source_code" value="false"/> +<setting id="cleanup.qualify_static_method_accesses_with_declaring_class" value="false"/> +<setting id="cleanup.add_missing_override_annotations" value="true"/> +<setting id="cleanup.convert_functional_interfaces" value="false"/> +<setting id="cleanup.remove_unused_private_types" value="true"/> +<setting id="cleanup.use_anonymous_class_creation" value="false"/> +<setting id="cleanup.use_type_arguments" value="false"/> +<setting id="cleanup.add_missing_methods" value="false"/> +<setting id="cleanup.make_local_variable_final" value="true"/> +<setting id="cleanup.correct_indentation" value="false"/> +<setting id="cleanup.add_missing_override_annotations_interface_methods" value="true"/> +<setting id="cleanup.remove_unused_imports" value="true"/> +<setting id="cleanup.remove_trailing_whitespaces_ignore_empty" value="false"/> +<setting id="cleanup.make_private_fields_final" value="true"/> +<setting id="cleanup.add_generated_serial_version_id" value="false"/> +<setting id="cleanup.organize_imports" value="false"/> +<setting id="cleanup.remove_trailing_whitespaces" value="true"/> +<setting id="cleanup.sort_members_all" value="false"/> +<setting id="cleanup.insert_inferred_type_arguments" value="false"/> +<setting id="cleanup.use_blocks_only_for_return_and_throw" value="false"/> +<setting id="cleanup.add_missing_annotations" value="true"/> +<setting id="cleanup.use_parentheses_in_expressions" value="false"/> +<setting id="cleanup.use_lambda" value="true"/> +<setting id="cleanup.qualify_static_field_accesses_with_declaring_class" value="false"/> +<setting id="cleanup.use_this_for_non_static_method_access_only_if_necessary" value="true"/> +<setting id="cleanup.use_this_for_non_static_method_access" value="false"/> +<setting id="cleanup.qualify_static_member_accesses_through_instances_with_declaring_class" value="true"/> +<setting id="cleanup.add_serial_version_id" value="false"/> +<setting id="cleanup.format_source_code_changes_only" value="false"/> +<setting id="cleanup.qualify_static_member_accesses_with_declaring_class" value="true"/> +<setting id="cleanup.always_use_blocks" value="true"/> +</profile> +</profiles> diff --git a/framework/src/onos/tools/dev/eclipse-formatter.xml b/framework/src/onos/tools/dev/eclipse-formatter.xml new file mode 100644 index 00000000..4383b5ab --- /dev/null +++ b/framework/src/onos/tools/dev/eclipse-formatter.xml @@ -0,0 +1,310 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- + ~ Copyright 2014 Open Networking Laboratory + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> +<profiles version="12"> +<profile kind="CodeFormatterProfile" name="ONOS-formatter" version="12"> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="8"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/> +<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="32"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/> +<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/> +<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="32"/> +<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/> +<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="32"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="82"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/> +<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/> +<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/> +<setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="32"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="32"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/> +</profile> +</profiles> diff --git a/framework/src/onos/tools/dev/header.txt b/framework/src/onos/tools/dev/header.txt new file mode 100644 index 00000000..6c18c92c --- /dev/null +++ b/framework/src/onos/tools/dev/header.txt @@ -0,0 +1,13 @@ +Copyright $today.year Open Networking Laboratory + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License.
\ No newline at end of file diff --git a/framework/src/onos/tools/dev/idea-settings.jar b/framework/src/onos/tools/dev/idea-settings.jar Binary files differnew file mode 100644 index 00000000..ad1826d9 --- /dev/null +++ b/framework/src/onos/tools/dev/idea-settings.jar diff --git a/framework/src/onos/tools/dev/onos.cshrc b/framework/src/onos/tools/dev/onos.cshrc new file mode 100644 index 00000000..e5d8e628 --- /dev/null +++ b/framework/src/onos/tools/dev/onos.cshrc @@ -0,0 +1,41 @@ +#!/bin/tcsh +# ONOS developer csh/tcsh profile conveniences +# Simply include in your own $HOME/.cshrc file. E.g.: +# +# setenv ONOS_ROOT $HOME/onos +# if ( -f $ONOS_ROOT/tools/dev/onos.cshrc ) then +# source $ONOS_ROOT/tools/dev/onos.cshrc +# endif +# + +# Root of the ONOS source tree +if ( ! $?ONOS_ROOT ) then + setenv ONOS_ROOT $HOME/onos +endif + +# Setup some environmental context for developers +if ( ! $?JAVA_HOME ) then + if ( -x /usr/libexec/java_home ) then + setenv JAVA_HOME `/usr/libexec/java_home -v 1.8` + else if ( -d /usr/lib/jvm/java-8-oracle ) then + setenv JAVA_HOME /usr/lib/jvm/java-8-oracle + else if ( -d /usr/lib/jvm/java-7-openjdk-amd64 ) then + setenv JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64 + endif +endif +if ( ! $?MAVEN ) then + setenv MAVEN $HOME/Applications/apache-maven-3.3.1 +endif +if ( ! $?KARAF_VERSION ) then + setenv KARAF_VERSION 3.0.3 +endif +if ( ! $?KARAF_ROOT ) then + setenv KARAF_ROOT $HOME/Applications/apache-karaf-$KARAF_VERSION +endif +setenv KARAF_LOG $KARAF_ROOT/data/log/karaf.log + +alias onos-setup-cell ' ( env ONOS_CELL=\!^ $ONOS_ROOT/tools/test/bin/onos-show-cell \!^ ) && setenv ONOS_CELL \!^' + +set path=( $path $ONOS_ROOT/tools/dev/bin $ONOS_ROOT/tools/test/bin ) +set path=( $path $ONOS_ROOT/tools/build ) +set path=( $path $KARAF_ROOT/bin ) |