module-info
).
It also supports an -ignore option to ignore references to classes
listed in the file (including .classlists created by the ClassAnalyzer tool).
java ShowDeps [-LFor example, to generate module declaration for SwingSet3:] [-id ] file... where is a class or JAR file, or a directory If -id option is specified, it will generate the module declaration. Example usages: java ShowDeps Foo.jar java ShowDeps -id "foo@1.0" Foo.jar java ShowDeps -L modulelibrary Foo.jar java ShowDeps -ignore base.classlist Foo.jar java ShowDeps -ignore base.classlist -ignore jaxp-parsers.classlist <dir>
$ java ShowDeps -id "swingset3 @ 1.0" swingx.jar swing-worker.jar AnimatedTransitions.jar TimingFramework.jar AppFramework.jar module swingset3 @ 1.0 { requires jdk.base; requires jdk.desktop; requires jdk.jdbc; requires jdk.jndi; requires jdk.logging; requires jdk.prefs; }
Input:
*.classlist, *.resources, *.dependencies
Class.forName
, service providers,
constants inlined by the compiler, and JNI_FindClass
.
In addition, it does not parse the annotations.
module swingset3 { // include classes in this module include com.sun.swingset3.**; // include resource files in this module include META-INF/demolist; // main entry point class com.sun.swingset3.SwingSet3; }The syntax is similar to
module-info.java
.
Directives are:
include
: classes or resources to be included in this module.
It can also include a module.exclude
: classes or resources to be excluded in this module.roots
: classes and all of its referenced classes (transitive closure)
to be included in this module.class
: main entry point for this modulerequire [optional]
: explicitly require a modulemodule-info.java
files for JDK modules
as a post-processing step. This is an interim solution
enabling us prototype a modular JDK and make change to
the module definitions during the course of our development,
for example, synchronizing the on-going JDK development
with the jdk8 repository.
Utimately, we will restructure the source tree so that
JDK modules will be compiled in the modulepath
that can be used for development and the image build.
Source tree restructuring has a big impact on all JDK engineers
and thus we should do this when the module definitions and
graph are close to final to minimize the disruption to the teams.
The configuration file for JDK is at:
modules.config
and
modules.group
.
Usage: ClassAnalyzer <options> Options: -classpath classpath where classes and jars will be parsed -config config file This option can be repeated to specify multiple config files. -jigsawLibrary module-library-path Default is the system module library if present. -moduleinfo output dir for module-info.java. If not specified, no module-info.java will be generated. -output output dir for the generated reports -properties module's properties -version version of the modules