< prev index next >

test/tools/jar/modularJar/Basic.java

Print this page




 814             commands.addAll(Arrays.asList(TOOL_VM_OPTIONS.split("\\s+", -1)));
 815         }
 816         commands.add("-d");
 817         commands.add(dest.toString());
 818         if (dest.toString().contains("bar"))
 819             commands.add("-XaddExports:java.base/jdk.internal.module=bar");
 820         if (modulePath != null) {
 821             commands.add("-mp");
 822             commands.add(modulePath.toString());
 823         }
 824         Stream.of(sourceFiles).map(Object::toString).forEach(x -> commands.add(x));
 825 
 826         quickFail(run(new ProcessBuilder(commands)));
 827     }
 828 
 829     static Result java(Path modulePath, String entryPoint, String... args) {
 830         String java = getJDKTool("java");
 831 
 832         List<String> commands = new ArrayList<>();
 833         commands.add(java);
 834         if (!VM_OPTIONS.isEmpty()) {
 835             commands.addAll(Arrays.asList(VM_OPTIONS.split("\\s+", -1)));
 836         }
 837         if (!JAVA_OPTIONS.isEmpty()) {
 838             commands.addAll(Arrays.asList(JAVA_OPTIONS.split("\\s+", -1)));
 839         }

 840         Stream.of(args).forEach(x -> commands.add(x));
 841         commands.add("-mp");
 842         commands.add(modulePath.toString());
 843         commands.add("-m");
 844         commands.add(entryPoint);
 845 
 846         return run(new ProcessBuilder(commands));
 847     }
 848 
 849     static Path[] fileList(Path directory) throws IOException {
 850         final List<Path> filePaths = new ArrayList<>();
 851         Files.walkFileTree(directory, new SimpleFileVisitor<Path>() {
 852             @Override
 853             public FileVisitResult visitFile(Path file,
 854                                              BasicFileAttributes attrs) {
 855                 filePaths.add(file);
 856                 return FileVisitResult.CONTINUE;
 857             }
 858         });
 859         return filePaths.toArray(new Path[filePaths.size()]);




 814             commands.addAll(Arrays.asList(TOOL_VM_OPTIONS.split("\\s+", -1)));
 815         }
 816         commands.add("-d");
 817         commands.add(dest.toString());
 818         if (dest.toString().contains("bar"))
 819             commands.add("-XaddExports:java.base/jdk.internal.module=bar");
 820         if (modulePath != null) {
 821             commands.add("-mp");
 822             commands.add(modulePath.toString());
 823         }
 824         Stream.of(sourceFiles).map(Object::toString).forEach(x -> commands.add(x));
 825 
 826         quickFail(run(new ProcessBuilder(commands)));
 827     }
 828 
 829     static Result java(Path modulePath, String entryPoint, String... args) {
 830         String java = getJDKTool("java");
 831 
 832         List<String> commands = new ArrayList<>();
 833         commands.add(java);
 834         //temporarily commenting out options for 8158855
 835         //if (!VM_OPTIONS.isEmpty()) {
 836         //    commands.addAll(Arrays.asList(VM_OPTIONS.split("\\s+", -1)));
 837         //}
 838         //if (!JAVA_OPTIONS.isEmpty()) {
 839         //    commands.addAll(Arrays.asList(JAVA_OPTIONS.split("\\s+", -1)));
 840         //}
 841         Stream.of(args).forEach(x -> commands.add(x));
 842         commands.add("-mp");
 843         commands.add(modulePath.toString());
 844         commands.add("-m");
 845         commands.add(entryPoint);
 846 
 847         return run(new ProcessBuilder(commands));
 848     }
 849 
 850     static Path[] fileList(Path directory) throws IOException {
 851         final List<Path> filePaths = new ArrayList<>();
 852         Files.walkFileTree(directory, new SimpleFileVisitor<Path>() {
 853             @Override
 854             public FileVisitResult visitFile(Path file,
 855                                              BasicFileAttributes attrs) {
 856                 filePaths.add(file);
 857                 return FileVisitResult.CONTINUE;
 858             }
 859         });
 860         return filePaths.toArray(new Path[filePaths.size()]);


< prev index next >