langtools/test/tools/lib/toolbox/JavacTask.java
changeset 37758 3ecf9b414e05
parent 36778 e04318f39f92
child 40308 274367a99f98
--- a/langtools/test/tools/lib/toolbox/JavacTask.java	Mon May 02 15:01:54 2016 -0700
+++ b/langtools/test/tools/lib/toolbox/JavacTask.java	Mon May 02 16:17:39 2016 -0700
@@ -103,6 +103,16 @@
     }
 
     /**
+     * Sets the classpath.
+     * @param classpath the classpath
+     * @return this task object
+     */
+    public JavacTask classpath(List<Path> classpath) {
+        this.classpath = classpath;
+        return this;
+    }
+
+    /**
      * Sets the sourcepath.
      * @param sourcepath the sourcepath
      * @return this task object
@@ -126,6 +136,16 @@
     }
 
     /**
+     * Sets the sourcepath.
+     * @param sourcepath the sourcepath
+     * @return this task object
+     */
+    public JavacTask sourcepath(List<Path> sourcepath) {
+        this.sourcepath = sourcepath;
+        return this;
+    }
+
+    /**
      * Sets the output directory.
      * @param outdir the output directory
      * @return this task object
@@ -188,6 +208,18 @@
     }
 
     /**
+     * Sets the files to be compiled or analyzed.
+     * @param files the files
+     * @return this task object
+     */
+    public JavacTask files(List<Path> files) {
+        this.files = files.stream()
+                .map(Path::toString)
+                .collect(Collectors.toList());
+        return this;
+    }
+
+    /**
      * Sets the sources to be compiled or analyzed.
      * Each source string is converted into an in-memory object that
      * can be passed directly to the compiler.