Review request for jdeps option rename to Java-style and enhancements to output dot file format
Mandy Chung
mandy.chung at oracle.com
Fri Oct 11 07:08:18 UTC 2013
There were some discussion of jdeps CLI to follow GNU style option
or the traditional Java style. As there will be plans to upgrade
the JDK tools to GNU style options, it'd be desirable to keep jdeps
be consistent with other langtools and be upgraded to GNU style in
a unified manner.
This patch includes the fixes for:
JDK-8015912: jdeps output in dot graph format and option to find API
dependences
JDK-8026255: Switch jdeps to follow traditional Java option style
Webrev at:
http://cr.openjdk.java.net/~mchung/jdk8/webrevs/8015912/webrev.00/
It includes 3 new options in addition to the option renaming:
1) -dotoutput <dir> Destination directory for DOT file output
(Note that this is different than the patch I post a few months ago).
If specified, the dependencies will be output in dot graph format
in the given directory. It will generate a summary file named
"summary.dot" to list the dependencies among the archives (.class file,
directory, or JAR file specified in the command line).
For each archive, there will also be a dot file listing the package-level or
class-level dependencies named "<archive-file-name>.dot"
The output will be like:
digraph "archive name" {
"from" -> "to";
}
where from and to can be a package name, class name or the filename being
processed depending on the verbose mode.
2) Restrict analysis on public APIs only
-apionly Restrict analysis to APIs i.e. dependences
from the signature of public and protected
members of public classes including field
type, method parameter types, returned type,
checked exception types etc
3) -include <regex> to restrict the analysis to classes matching
the given regular expression
This option filters the list of classes to be analyzed.
It can be used together with -p and -e which apply the pattern
to the dependences.
---------------
Usage: jdeps <options> <classes...>
where <classes> can be a pathname to a .class file, a directory, a JAR file,
or a fully-qualified class name. Possible options include:
-dotoutput <dir> Destination directory for DOT file output
-s -summary Print dependency summary only
-v -verbose Print all class level dependencies
-verbose:package Print package-level dependencies excluding
dependencies within the same archive
-verbose:class Print class-level dependencies excluding
dependencies within the same archive
-cp <path> -classpath <path> Specify where to find class files
-p <pkgname> -package <pkgname> Finds dependences in the given package
(may be given multiple times)
-e <regex> -regex <regex> Finds dependences in packages matching pattern
(-p and -e are exclusive)
-include <regex> Restrict analysis to classes matching pattern
This option filters the list of classes to
be analyzed. It can be used together with
-p and -e which apply pattern to the dependences
-P -profile Show profile or the file containing a package
-apionly Restrict analysis to APIs i.e. dependences
from the signature of public and protected
members of public classes including field
type, method parameter types, returned type,
checked exception types etc
-recursive Recursively traverse all dependencies
-version Version information
More information about the core-libs-dev
mailing list