tom

Added onos-build-selective & obs short-hand.

...@@ -12,9 +12,8 @@ export KARAF=${KARAF:-~/Applications/apache-karaf-3.0.1} ...@@ -12,9 +12,8 @@ export KARAF=${KARAF:-~/Applications/apache-karaf-3.0.1}
12 export KARAF_LOG=$KARAF/data/log/karaf.log 12 export KARAF_LOG=$KARAF/data/log/karaf.log
13 13
14 # Setup a path 14 # Setup a path
15 -export PS=":" 15 +export PATH="$PATH:$ONOS_ROOT/tools/dev/bin:$ONOS_ROOT/tools/test/bin"
16 -export PATH="$PATH:$ONOS_ROOT/tools/dev:$ONOS_ROOT/tools/build" 16 +export PATH="$PATH:$ONOS_ROOT/tools/build"
17 -export PATH="$PATH:$ONOS_ROOT/tools/test/bin"
18 export PATH="$PATH:$MAVEN/bin:$KARAF/bin" 17 export PATH="$PATH:$MAVEN/bin:$KARAF/bin"
19 export PATH="$PATH:." 18 export PATH="$PATH:."
20 19
...@@ -30,11 +29,12 @@ alias mci='mvn clean install' ...@@ -30,11 +29,12 @@ alias mci='mvn clean install'
30 29
31 # Short-hand for ONOS build, package and test. 30 # Short-hand for ONOS build, package and test.
32 alias ob='onos-build' 31 alias ob='onos-build'
32 +alias obs='onos-build-selective'
33 alias op='onos-package' 33 alias op='onos-package'
34 alias ot='onos-test' 34 alias ot='onos-test'
35 35
36 # Short-hand for tailing the ONOS (karaf) log 36 # Short-hand for tailing the ONOS (karaf) log
37 -alias tl='$ONOS_ROOT/tools/dev/watchLog' 37 +alias tl='$ONOS_ROOT/tools/dev/bin/onos-local-log'
38 alias tlo='tl | grep --colour=always org.onlab' 38 alias tlo='tl | grep --colour=always org.onlab'
39 39
40 # Pretty-print JSON output 40 # Pretty-print JSON output
......
1 +#!/bin/bash
2 +#------------------------------------------------------------------------------
3 +# Selectively builds only those projects that contained modified Java files.
4 +#------------------------------------------------------------------------------
5 +
6 +projects=$(find $ONOS_ROOT -name '*.java' \
7 + -not -path '*/openflowj/*' -and -not -path '.git/*' \
8 + -exec $ONOS_ROOT/tools/dev/bin/onos-build-selective-hook {} \; | \
9 + sort -u | sed "s:$ONOS_ROOT::g" | tr '\n' ',' | \
10 + sed 's:/,:,:g;s:,/:,:g;s:^/::g;s:,$::g')
11 +
12 +[ -n "$projects" ] && cd $ONOS_ROOT && mvn --projects $projects ${@:-clean install}
...\ No newline at end of file ...\ No newline at end of file
1 +#------------------------------------------------------------------------------
2 +# Echoes project-level directory if a Java file within is newer than its
3 +# class file counterpart
4 +#------------------------------------------------------------------------------
5 +
6 +javaFile=${1#*\/src\/*\/java/}
7 +basename=${1/*\//}
8 +
9 +[ $basename = "package-info.java" ] && exit 0
10 +
11 +src=${1/$javaFile/}
12 +project=${src/src*/}
13 +classFile=${javaFile/.java/.class}
14 +
15 +[ ${project}target/classes/$classFile -nt ${src}$javaFile -o \
16 + ${project}target/test-classes/$classFile -nt ${src}$javaFile ] \
17 + || echo ${src/src*/}
18 +