< prev index next >

jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java

Print this page




 179                 List<Path> paths = new ArrayList<>(dirs.length);
 180                 for (String dir : dirs) {
 181                     paths.add(Paths.get(dir));
 182                 }
 183 
 184                 pluginsLayer = createPluginsLayer(paths);
 185             }
 186 
 187             Set<String> optionsSeen = new HashSet<>();
 188             for (Plugin plugin : PluginRepository.
 189                     getPlugins(pluginsLayer)) {
 190                 if (!Utils.isDisabled(plugin)) {
 191                     addOrderedPluginOptions(plugin, optionsSeen);
 192                 }
 193             }
 194             mainOptions.add(new PlugOption(false,
 195                     (task, opt, arg) -> {
 196                         // This option is handled prior
 197                         // to have the options parsed.
 198                     },
 199                     "--plugins-modulepath"));
 200             mainOptions.add(new PlugOption(true, (task, opt, arg) -> {
 201                 Path path = Paths.get(arg);
 202                 if (!Files.exists(path) || !Files.isDirectory(path)) {
 203                     throw newBadArgs("err.existing.image.must.exist");
 204                 }
 205                 existingImage = path.toAbsolutePath();
 206             }, true, POST_PROCESS));
 207             mainOptions.add(new PlugOption(true,
 208                     (task, opt, arg) -> {
 209                         lastSorter = arg;
 210                     },
 211                     true, "--resources-last-sorter"));
 212             mainOptions.add(new PlugOption(false,
 213                     (task, opt, arg) -> {
 214                         listPlugins = true;
 215                     },
 216                     "--list-plugins"));
 217         }
 218 
 219         private List<Map<String, String>> argListFor(Plugin plugin) {




 179                 List<Path> paths = new ArrayList<>(dirs.length);
 180                 for (String dir : dirs) {
 181                     paths.add(Paths.get(dir));
 182                 }
 183 
 184                 pluginsLayer = createPluginsLayer(paths);
 185             }
 186 
 187             Set<String> optionsSeen = new HashSet<>();
 188             for (Plugin plugin : PluginRepository.
 189                     getPlugins(pluginsLayer)) {
 190                 if (!Utils.isDisabled(plugin)) {
 191                     addOrderedPluginOptions(plugin, optionsSeen);
 192                 }
 193             }
 194             mainOptions.add(new PlugOption(false,
 195                     (task, opt, arg) -> {
 196                         // This option is handled prior
 197                         // to have the options parsed.
 198                     },
 199                     "--plugin-module-path"));
 200             mainOptions.add(new PlugOption(true, (task, opt, arg) -> {
 201                 Path path = Paths.get(arg);
 202                 if (!Files.exists(path) || !Files.isDirectory(path)) {
 203                     throw newBadArgs("err.existing.image.must.exist");
 204                 }
 205                 existingImage = path.toAbsolutePath();
 206             }, true, POST_PROCESS));
 207             mainOptions.add(new PlugOption(true,
 208                     (task, opt, arg) -> {
 209                         lastSorter = arg;
 210                     },
 211                     true, "--resources-last-sorter"));
 212             mainOptions.add(new PlugOption(false,
 213                     (task, opt, arg) -> {
 214                         listPlugins = true;
 215                     },
 216                     "--list-plugins"));
 217         }
 218 
 219         private List<Map<String, String>> argListFor(Plugin plugin) {


< prev index next >