aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/utils/jdvue/bin
diff options
context:
space:
mode:
authorAshlee Young <ashlee@onosfw.com>2015-09-09 22:15:21 -0700
committerAshlee Young <ashlee@onosfw.com>2015-09-09 22:15:21 -0700
commit13d05bc8458758ee39cb829098241e89616717ee (patch)
tree22a4d1ce65f15952f07a3df5af4b462b4697cb3a /framework/src/onos/utils/jdvue/bin
parent6139282e1e93c2322076de4b91b1c85d0bc4a8b3 (diff)
ONOS checkin based on commit tag e796610b1f721d02f9b0e213cf6f7790c10ecd60
Change-Id: Ife8810491034fe7becdba75dda20de4267bd15cd
Diffstat (limited to 'framework/src/onos/utils/jdvue/bin')
-rwxr-xr-xframework/src/onos/utils/jdvue/bin/jdvue31
-rwxr-xr-xframework/src/onos/utils/jdvue/bin/jdvue-scan12
2 files changed, 43 insertions, 0 deletions
diff --git a/framework/src/onos/utils/jdvue/bin/jdvue b/framework/src/onos/utils/jdvue/bin/jdvue
new file mode 100755
index 00000000..86adfb4f
--- /dev/null
+++ b/framework/src/onos/utils/jdvue/bin/jdvue
@@ -0,0 +1,31 @@
+#!/bin/bash
+#-------------------------------------------------------------------------------
+# Java Package Dependency viewer
+#
+# written by Thomas Vachuska
+# -- Doobs --
+#-------------------------------------------------------------------------------
+
+JDVUE_ROOT=${JDVUE_ROOT:-$(dirname $0)/..}
+cd $JDVUE_ROOT
+VER=1.3.0-SNAPSHOT
+JAR=$PWD/target/jdvue-${VER}.jar # start with the dev jar first
+cd - >/dev/null
+
+# If the dev jar is not available, use one from .m2/repository
+[ -f ${JAR} ] || JAR=~/.m2/repository/org/onlab/tools/jdvue/${VER}/jdvue-${VER}.jar
+
+# 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
+
+# Use the rest of the arguments as paths to scan for sources to build catalog
+find "${@:-.}" -type f -name \*.java \
+ | grep -v -E '/lost+found/|/target/|archetype-resources' \
+ | xargs grep -E "^[ \t]*import .*;.*|^[ \t]*package .*;.*" \
+ | tr -d '\r' > $name.db
+
+# Now run the Java Dependency Viewer jar on the catalog
+java -jar ${JAR} $name && rm $name.db && open $name.html
diff --git a/framework/src/onos/utils/jdvue/bin/jdvue-scan b/framework/src/onos/utils/jdvue/bin/jdvue-scan
new file mode 100755
index 00000000..216c68d7
--- /dev/null
+++ b/framework/src/onos/utils/jdvue/bin/jdvue-scan
@@ -0,0 +1,12 @@
+#!/bin/bash
+#-------------------------------------------------------------------------------
+# Java Package Dependency scanner
+#
+# written by Thomas Vachuska
+# -- Doobs --
+#-------------------------------------------------------------------------------
+
+find "${@:-.}" -type f -name \*.java \
+ | grep -v -E '/lost+found/|/target/' \
+ | xargs grep -E "^[ \t]*import .*;.*|^[ \t]*package .*;.*" \
+ | tr -d '\r' > jpd.db