jdk/test/tools/lib/tests/JImageGenerator.java
changeset 41212 54a8bb41b174
parent 40261 86a49ba76f52
child 41484 834b7539ada3
--- a/jdk/test/tools/lib/tests/JImageGenerator.java	Wed Sep 28 19:21:42 2016 +0300
+++ b/jdk/test/tools/lib/tests/JImageGenerator.java	Wed Sep 28 22:13:14 2016 +0530
@@ -564,6 +564,10 @@
         private final List<String> limitMods = new ArrayList<>();
         private final List<String> options = new ArrayList<>();
         private String modulePath;
+        // if you want to specifiy repeated --module-path option
+        private String repeatedModulePath;
+        // if you want to specifiy repeated --limit-modules option
+        private String repeatedLimitMods;
         private Path output;
         private Path existing;
 
@@ -572,6 +576,11 @@
             return this;
         }
 
+        public JLinkTask repeatedModulePath(String modulePath) {
+            this.repeatedModulePath = modulePath;
+            return this;
+        }
+
         public JLinkTask addJars(Path jars) {
             this.jars.add(jars);
             return this;
@@ -597,6 +606,11 @@
             return this;
         }
 
+        public JLinkTask repeatedLimitMods(String modules) {
+            this.repeatedLimitMods = modules;
+            return this;
+        }
+
         public JLinkTask output(Path output) {
             this.output = output;
             return this;
@@ -639,6 +653,10 @@
                 options.add(LIMIT_MODULES_OPTION);
                 options.add(limitMods.stream().collect(Collectors.joining(",")));
             }
+            if (repeatedLimitMods != null) {
+                options.add(LIMIT_MODULES_OPTION);
+                options.add(repeatedLimitMods);
+            }
             if (!jars.isEmpty() || !jmods.isEmpty()) {
                 options.add(MODULE_PATH_OPTION);
                 options.add(modulePath());
@@ -647,6 +665,10 @@
                 options.add(MODULE_PATH_OPTION);
                 options.add(modulePath);
             }
+            if (repeatedModulePath != null) {
+                options.add(MODULE_PATH_OPTION);
+                options.add(repeatedModulePath);
+            }
             if (!pluginModulePath.isEmpty()) {
                 options.add(PLUGIN_MODULE_PATH);
                 options.add(toPath(pluginModulePath));