94 }
95 File srcDir = new File(getVerifierDir(), "src");
96 List<File> javaFileList = findFiles(srcDir, createFilter(JAVA_FILE_EXT));
97 File tmpFile = File.createTempFile("javac", ".tmp", new File("."));
98 XCLASSES.mkdirs();
99 FileOutputStream fos = null;
100 PrintStream ps = null;
101 try {
102 fos = new FileOutputStream(tmpFile);
103 ps = new PrintStream(fos);
104 for (File f : javaFileList) {
105 ps.println(f.getAbsolutePath());
106 }
107 } finally {
108 close(ps);
109 close(fos);
110 }
111
112 compiler("-d",
113 XCLASSES.getName(),
114 "--add-exports=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED",
115 "@" + tmpFile.getAbsolutePath());
116
117 jar("cvfe",
118 VerifierJar.getName(),
119 "sun.tools.pack.verify.Main",
120 "-C",
121 XCLASSES.getName(),
122 ".");
123 }
124
125 private static File getVerifierDir() {
126 File srcDir = new File(TEST_SRC_DIR, VERIFIER_DIR_NAME);
127 if (!srcDir.exists()) {
128 // if not available try one level above
129 srcDir = new File(TEST_SRC_DIR.getParentFile(), VERIFIER_DIR_NAME);
130 }
131 return srcDir;
132 }
133
|
94 }
95 File srcDir = new File(getVerifierDir(), "src");
96 List<File> javaFileList = findFiles(srcDir, createFilter(JAVA_FILE_EXT));
97 File tmpFile = File.createTempFile("javac", ".tmp", new File("."));
98 XCLASSES.mkdirs();
99 FileOutputStream fos = null;
100 PrintStream ps = null;
101 try {
102 fos = new FileOutputStream(tmpFile);
103 ps = new PrintStream(fos);
104 for (File f : javaFileList) {
105 ps.println(f.getAbsolutePath());
106 }
107 } finally {
108 close(ps);
109 close(fos);
110 }
111
112 compiler("-d",
113 XCLASSES.getName(),
114 "--add-modules=jdk.jdeps",
115 "--add-exports=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED",
116 "@" + tmpFile.getAbsolutePath());
117
118 jar("cvfe",
119 VerifierJar.getName(),
120 "sun.tools.pack.verify.Main",
121 "-C",
122 XCLASSES.getName(),
123 ".");
124 }
125
126 private static File getVerifierDir() {
127 File srcDir = new File(TEST_SRC_DIR, VERIFIER_DIR_NAME);
128 if (!srcDir.exists()) {
129 // if not available try one level above
130 srcDir = new File(TEST_SRC_DIR.getParentFile(), VERIFIER_DIR_NAME);
131 }
132 return srcDir;
133 }
134
|