< prev index next >
langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java
Print this page
*** 142,152 ****
return true;
}
}
static Option[] recognizedOptions = {
! new Option(false, "-h", "-?", "-help") {
void process(JdepsTask task, String opt, String arg) {
task.options.help = true;
}
},
new Option(true, "-dotoutput") {
--- 142,152 ----
return true;
}
}
static Option[] recognizedOptions = {
! new Option(false, "-h", "-?", "-help", "--help") {
void process(JdepsTask task, String opt, String arg) {
task.options.help = true;
}
},
new Option(true, "-dotoutput") {
*** 193,210 ****
new Option(false, "-apionly") {
void process(JdepsTask task, String opt, String arg) {
task.options.apiOnly = true;
}
},
! new Option(true, "-check") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
Set<String> mods = Set.of(arg.split(","));
task.options.checkModuleDeps = mods;
task.options.addmods.addAll(mods);
}
},
! new Option(true, "-genmoduleinfo") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
Path p = Paths.get(arg);
if (Files.exists(p) && (!Files.isDirectory(p) || !Files.isWritable(p))) {
throw new BadArgs("err.invalid.path", arg);
}
--- 193,210 ----
new Option(false, "-apionly") {
void process(JdepsTask task, String opt, String arg) {
task.options.apiOnly = true;
}
},
! new Option(true, "--check") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
Set<String> mods = Set.of(arg.split(","));
task.options.checkModuleDeps = mods;
task.options.addmods.addAll(mods);
}
},
! new Option(true, "--gen-module-info") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
Path p = Paths.get(arg);
if (Files.exists(p) && (!Files.isDirectory(p) || !Files.isWritable(p))) {
throw new BadArgs("err.invalid.path", arg);
}
*** 220,245 ****
}
}
},
// ---- paths option ----
! new Option(true, "-cp", "-classpath") {
void process(JdepsTask task, String opt, String arg) {
task.options.classpath = arg;
}
},
! new Option(true, "-mp", "-modulepath") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
task.options.modulePath = arg;
}
},
! new Option(true, "-upgrademodulepath") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
task.options.upgradeModulePath = arg;
}
},
! new Option(true, "-system") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
if (arg.equals("none")) {
task.options.systemModulePath = null;
} else {
Path path = Paths.get(arg);
--- 220,245 ----
}
}
},
// ---- paths option ----
! new Option(true, "-cp", "-classpath", "--class-path") {
void process(JdepsTask task, String opt, String arg) {
task.options.classpath = arg;
}
},
! new Option(true, "--module-path") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
task.options.modulePath = arg;
}
},
! new Option(true, "--upgrade-module-path") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
task.options.upgradeModulePath = arg;
}
},
! new Option(true, "--system") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
if (arg.equals("none")) {
task.options.systemModulePath = null;
} else {
Path path = Paths.get(arg);
*** 248,264 ****
else
throw new BadArgs("err.invalid.path", arg);
}
}
},
! new Option(true, "-addmods") {
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") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
task.options.rootModule = arg;
task.options.addmods.add(arg);
}
},
--- 248,264 ----
else
throw new BadArgs("err.invalid.path", arg);
}
}
},
! new Option(true, "--add-modules") {
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 {
task.options.rootModule = arg;
task.options.addmods.add(arg);
}
},
*** 312,322 ****
task.options.includePattern = Pattern.compile(arg);
}
},
// Another alternative to list modules in -addmods option
! new HiddenOption(true, "-include-system-modules") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
task.options.includeSystemModulePattern = Pattern.compile(arg);
}
},
--- 312,322 ----
task.options.includePattern = Pattern.compile(arg);
}
},
// Another alternative to list modules in -addmods option
! new HiddenOption(true, "--include-system-modules") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
task.options.includeSystemModulePattern = Pattern.compile(arg);
}
},
*** 343,353 ****
task.options.filterSamePackage = true;
task.options.filterSameArchive = true;
}
},
! new Option(false, "-ct", "-compile-time") {
void process(JdepsTask task, String opt, String arg) {
task.options.compileTimeView = true;
task.options.filterSamePackage = true;
task.options.filterSameArchive = true;
task.options.depth = 0;
--- 343,353 ----
task.options.filterSamePackage = true;
task.options.filterSameArchive = true;
}
},
! new Option(false, "--compile-time") {
void process(JdepsTask task, String opt, String arg) {
task.options.compileTimeView = true;
task.options.filterSamePackage = true;
task.options.filterSameArchive = true;
task.options.depth = 0;
*** 373,383 ****
new HiddenOption(false, "-showlabel") {
void process(JdepsTask task, String opt, String arg) {
task.options.showLabel = true;
}
},
! new HiddenOption(false, "-hide-module") {
void process(JdepsTask task, String opt, String arg) {
task.options.showModule = false;
}
},
new HiddenOption(true, "-depth") {
--- 373,383 ----
new HiddenOption(false, "-showlabel") {
void process(JdepsTask task, String opt, String arg) {
task.options.showLabel = true;
}
},
! new HiddenOption(false, "--hide-show-module") {
void process(JdepsTask task, String opt, String arg) {
task.options.showModule = false;
}
},
new HiddenOption(true, "-depth") {
*** 462,472 ****
if (options.showSummary && options.verbose != SUMMARY) {
showHelp();
return EXIT_CMDERR;
}
if (options.checkModuleDeps != null && !inputArgs.isEmpty()) {
! reportError("err.invalid.module.option", inputArgs, "-check");
}
boolean ok = run();
return ok ? EXIT_OK : EXIT_ERROR;
} catch (BadArgs|UncheckedBadArgs e) {
--- 462,472 ----
if (options.showSummary && options.verbose != SUMMARY) {
showHelp();
return EXIT_CMDERR;
}
if (options.checkModuleDeps != null && !inputArgs.isEmpty()) {
! reportError("err.invalid.module.option", inputArgs, "--check");
}
boolean ok = run();
return ok ? EXIT_OK : EXIT_ERROR;
} catch (BadArgs|UncheckedBadArgs e) {
*** 499,514 ****
Stream.concat(options.addmods.stream(), options.requires.stream())
.filter(mn -> !config.isValidToken(mn))
.forEach(mn -> config.findModule(mn).orElseThrow(() ->
new UncheckedBadArgs(new BadArgs("err.module.not.found", mn))));
! // -genmoduleinfo
if (options.genModuleInfo != null) {
return genModuleInfo(config);
}
! // -check
if (options.checkModuleDeps != null) {
return new ModuleAnalyzer(config, log, options.checkModuleDeps).run();
}
if (options.dotOutputDir != null &&
--- 499,514 ----
Stream.concat(options.addmods.stream(), options.requires.stream())
.filter(mn -> !config.isValidToken(mn))
.forEach(mn -> config.findModule(mn).orElseThrow(() ->
new UncheckedBadArgs(new BadArgs("err.module.not.found", mn))));
! // --gen-module-info
if (options.genModuleInfo != null) {
return genModuleInfo(config);
}
! // --check
if (options.checkModuleDeps != null) {
return new ModuleAnalyzer(config, log, options.checkModuleDeps).run();
}
if (options.dotOutputDir != null &&
< prev index next >