< prev index next >
src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java
Print this page
@@ -232,53 +232,10 @@
task.options.includePattern = Pattern.compile(".*");
}
}
},
- new Option(true, CommandOption.CHECK_MODULES) {
- void process(JdepsTask task, String opt, String arg) throws BadArgs {
- if (task.command != null) {
- throw new BadArgs("err.command.set", task.command, opt);
- }
- Set<String> mods = Set.of(arg.split(","));
- task.options.addmods.addAll(mods);
- task.command = task.checkModuleDeps(mods);
- }
- },
- new Option(true, CommandOption.GENERATE_MODULE_INFO) {
- void process(JdepsTask task, String opt, String arg) throws BadArgs {
- if (task.command != null) {
- throw new BadArgs("err.command.set", task.command, opt);
- }
- task.command = task.genModuleInfo(Paths.get(arg), false);
- }
- },
- new Option(true, CommandOption.GENERATE_OPEN_MODULE) {
- void process(JdepsTask task, String opt, String arg) throws BadArgs {
- if (task.command != null) {
- throw new BadArgs("err.command.set", task.command, opt);
- }
- task.command = task.genModuleInfo(Paths.get(arg), true);
- }
- },
- new Option(false, CommandOption.LIST_DEPS) {
- void process(JdepsTask task, String opt, String arg) throws BadArgs {
- if (task.command != null) {
- throw new BadArgs("err.command.set", task.command, opt);
- }
- task.command = task.listModuleDeps(false);
- }
- },
- new Option(false, CommandOption.LIST_REDUCED_DEPS) {
- void process(JdepsTask task, String opt, String arg) throws BadArgs {
- if (task.command != null) {
- throw new BadArgs("err.command.set", task.command, opt);
- }
- task.command = task.listModuleDeps(true);
- }
- },
-
// ---- paths option ----
new Option(true, "-cp", "-classpath", "--class-path") {
void process(JdepsTask task, String opt, String arg) {
task.options.classpath = arg;
}
@@ -310,19 +267,10 @@
void process(JdepsTask task, String opt, String arg) throws BadArgs {
Set<String> mods = Set.of(arg.split(","));
task.options.addmods.addAll(mods);
}
},
- new Option(true, "-m", "--module") {
- void process(JdepsTask task, String opt, String arg) throws BadArgs {
- if (!task.options.rootModules.isEmpty()) {
- throw new BadArgs("err.option.already.specified", opt);
- }
- task.options.rootModules.add(arg);
- task.options.addmods.add(arg);
- }
- },
new Option(true, "--multi-release") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
if (arg.equalsIgnoreCase("base")) {
task.options.multiRelease = JarFile.baseVersion();
} else {
@@ -336,10 +284,74 @@
}
task.options.multiRelease = Runtime.Version.parse(arg);
}
}
},
+ new Option(false, "-q", "-quiet") {
+ void process(JdepsTask task, String opt, String arg) {
+ task.options.nowarning = true;
+ }
+ },
+ new Option(false, "-version", "--version") {
+ void process(JdepsTask task, String opt, String arg) {
+ task.options.version = true;
+ }
+ },
+
+ // ---- module-specific options ----
+
+ new Option(true, "-m", "--module") {
+ void process(JdepsTask task, String opt, String arg) throws BadArgs {
+ if (!task.options.rootModules.isEmpty()) {
+ throw new BadArgs("err.option.already.specified", opt);
+ }
+ task.options.rootModules.add(arg);
+ task.options.addmods.add(arg);
+ }
+ },
+ new Option(true, CommandOption.GENERATE_MODULE_INFO) {
+ void process(JdepsTask task, String opt, String arg) throws BadArgs {
+ if (task.command != null) {
+ throw new BadArgs("err.command.set", task.command, opt);
+ }
+ task.command = task.genModuleInfo(Paths.get(arg), false);
+ }
+ },
+ new Option(true, CommandOption.GENERATE_OPEN_MODULE) {
+ void process(JdepsTask task, String opt, String arg) throws BadArgs {
+ if (task.command != null) {
+ throw new BadArgs("err.command.set", task.command, opt);
+ }
+ task.command = task.genModuleInfo(Paths.get(arg), true);
+ }
+ },
+ new Option(true, CommandOption.CHECK_MODULES) {
+ void process(JdepsTask task, String opt, String arg) throws BadArgs {
+ if (task.command != null) {
+ throw new BadArgs("err.command.set", task.command, opt);
+ }
+ Set<String> mods = Set.of(arg.split(","));
+ task.options.addmods.addAll(mods);
+ task.command = task.checkModuleDeps(mods);
+ }
+ },
+ new Option(false, CommandOption.LIST_DEPS) {
+ void process(JdepsTask task, String opt, String arg) throws BadArgs {
+ if (task.command != null) {
+ throw new BadArgs("err.command.set", task.command, opt);
+ }
+ task.command = task.listModuleDeps(false);
+ }
+ },
+ new Option(false, CommandOption.LIST_REDUCED_DEPS) {
+ void process(JdepsTask task, String opt, String arg) throws BadArgs {
+ if (task.command != null) {
+ throw new BadArgs("err.command.set", task.command, opt);
+ }
+ task.command = task.listModuleDeps(true);
+ }
+ },
// ---- Target filtering options ----
new Option(true, "-p", "-package", "--package") {
void process(JdepsTask task, String opt, String arg) {
task.options.packageNames.add(arg);
@@ -422,21 +434,10 @@
task.options.filterSameArchive = true;
task.options.depth = 0;
}
},
- new Option(false, "-q", "-quiet") {
- void process(JdepsTask task, String opt, String arg) {
- task.options.nowarning = true;
- }
- },
-
- new Option(false, "-version", "--version") {
- void process(JdepsTask task, String opt, String arg) {
- task.options.version = true;
- }
- },
new HiddenOption(false, "-fullversion") {
void process(JdepsTask task, String opt, String arg) {
task.options.fullVersion = true;
}
},
< prev index next >