equal
deleted
inserted
replaced
29 * @library /tools/lib |
29 * @library /tools/lib |
30 * @modules jdk.compiler/com.sun.tools.javac.api |
30 * @modules jdk.compiler/com.sun.tools.javac.api |
31 * jdk.compiler/com.sun.tools.javac.file |
31 * jdk.compiler/com.sun.tools.javac.file |
32 * jdk.compiler/com.sun.tools.javac.main |
32 * jdk.compiler/com.sun.tools.javac.main |
33 * jdk.compiler/com.sun.tools.javac.util |
33 * jdk.compiler/com.sun.tools.javac.util |
34 * jdk.jdeps/com.sun.tools.javap |
34 * @build toolbox.ToolBox toolbox.JarTask |
35 * @build ToolBox |
|
36 * @run main T6725036 |
35 * @run main T6725036 |
37 */ |
36 */ |
38 |
37 |
39 import java.io.File; |
38 import java.io.File; |
40 import java.io.IOException; |
39 import java.io.IOException; |
46 import javax.tools.*; |
45 import javax.tools.*; |
47 |
46 |
48 import com.sun.tools.javac.file.JavacFileManager; |
47 import com.sun.tools.javac.file.JavacFileManager; |
49 import com.sun.tools.javac.file.RelativePath.RelativeFile; |
48 import com.sun.tools.javac.file.RelativePath.RelativeFile; |
50 import com.sun.tools.javac.util.Context; |
49 import com.sun.tools.javac.util.Context; |
|
50 |
|
51 import toolbox.JarTask; |
|
52 import toolbox.ToolBox; |
51 |
53 |
52 public class T6725036 { |
54 public class T6725036 { |
53 public static void main(String... args) throws Exception { |
55 public static void main(String... args) throws Exception { |
54 new T6725036().run(); |
56 new T6725036().run(); |
55 } |
57 } |
80 File createJar(String name, String... paths) throws IOException { |
82 File createJar(String name, String... paths) throws IOException { |
81 JavaCompiler comp = ToolProvider.getSystemJavaCompiler(); |
83 JavaCompiler comp = ToolProvider.getSystemJavaCompiler(); |
82 try (JavaFileManager fm = comp.getStandardFileManager(null, null, null)) { |
84 try (JavaFileManager fm = comp.getStandardFileManager(null, null, null)) { |
83 File f = new File(name); |
85 File f = new File(name); |
84 ToolBox tb = new ToolBox(); |
86 ToolBox tb = new ToolBox(); |
85 tb.new JarTask(name) |
87 new JarTask(tb, name) |
86 .files(fm, StandardLocation.PLATFORM_CLASS_PATH, paths) |
88 .files(fm, StandardLocation.PLATFORM_CLASS_PATH, paths) |
87 .run(); |
89 .run(); |
88 return f; |
90 return f; |
89 } |
91 } |
90 } |
92 } |