Bumping JDVUE to 2.2

Change-Id: I59ccd6c8d57f7b2c0cd2d23ee4a9f6b43f5de42a
diff --git a/tools/dev/bin/jdvue b/tools/dev/bin/jdvue
index fef5f0c..91650d5 100755
--- a/tools/dev/bin/jdvue
+++ b/tools/dev/bin/jdvue
@@ -3,7 +3,7 @@
 #   Java Package Dependency viewer
 #-------------------------------------------------------------------------------
 
-VER=${JDVUE_VERSION:-2.1}
+VER=${JDVUE_VERSION:-2.2}
 JAR=~/.m2/repository/org/onosproject/jdvue/$VER/jdvue-$VER.jar
 
 # Download the jdvue binary if needed
@@ -15,14 +15,21 @@
     [ -f $JAR ] && printf "Done.\n"
 fi
 
-# Assume default project to be the base-name of the argument or of current dir
-name=$(basename ${1:-$PWD})
-
 # If the -n option is specified use the next argument as the catalog name
 [ "$1" = "-n" -a $# -ge 2 ] && name=$2 && shift 2
 
+# If the -t option is specified, use only test sources; -a use all sources
+# If the -m option is specified, use only main sources; default.
+[ "$1" = "-m" ] && srcPattern="/src/main/java/" && shift 1
+[ "$1" = "-t" ] && srcPattern="/src/test/java/" && shift 1
+[ "$1" = "-a" ] && srcPattern="/src/(main|test)/java/" && shift 1
+
+# Assume default project to be the base-name of the argument or of current dir
+name=$(basename ${1:-$PWD})
+
 # Use the rest of the arguments as paths to scan for sources to build catalog
 find "${@:-.}" -type f -name \*.java \
+    | grep -E "${srcPattern:-/src/main/java}" \
     | grep -v -E '/lost+found/|/target/|archetype-resources' \
     | xargs grep -E "^[ \t]*import .*;.*|^[ \t]*package .*;.*" \
     | tr -d '\r' > $name.db