< prev index next >

functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/AppWrapper.java

Print this page

        

*** 119,128 **** --- 119,129 ---- for (ExtensionType extension : extensionArray) { Utils.createDir(Paths.get(getModulePathBasedOnExtension(extension))); } } + private List<Source> getJarTempSources() { return sources.stream().filter((source) -> !source.isModule()) .collect(Collectors.toList()); }
*** 198,208 **** public int compileApp(String[] javacOptions, Path... classpath) throws IOException { return compileApp(javacOptions, null, classpath); } ! public int compileAndCreateJavaExtensionProduct(ExtensionType extension, Path... classpath) throws IOException, ExecutionException { int resultForModule = compileAppForModules(new String[0], extension, classpath); jarApp(extension); compileAppForJars(new String[0], extension, classpath); jarApp(ExtensionType.NormalJar); return resultForModule; --- 199,209 ---- public int compileApp(String[] javacOptions, Path... classpath) throws IOException { return compileApp(javacOptions, null, classpath); } ! public int compileAndCreateExtensionEndProduct(ExtensionType extension, Path... classpath) throws IOException, ExecutionException { int resultForModule = compileAppForModules(new String[0], extension, classpath); jarApp(extension); compileAppForJars(new String[0], extension, classpath); jarApp(ExtensionType.NormalJar); return resultForModule;
*** 229,238 **** --- 230,240 ---- int result = 0; for (Source tempSource : getJarTempSources()) { List<String> newArgs = new ArrayList<String>(); newArgs.addAll(argsList); + newArgs.add("-classpath"); if (classpath.length != 0) { newArgs.add(Stream.of(classpath) .map(eachPath -> eachPath.toAbsolutePath().toString()) .collect(joining(File.pathSeparator)));
*** 263,279 **** return FileVisitResult.CONTINUE; } }); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ! LOG.log(Level.INFO, ! "====================COMPILATION STARTS FOR NORMAL JAR==========================="); ! LOG.log(Level.INFO,"compilation command for jars is " + newArgs); result = compiler.run(System.in, outputStream, System.err, newArgs.toArray(new String[newArgs.size()])); ! LOG.log(Level.INFO, ! "====================COMPILATION ENDS FOR NORMAL JAR============================="); } return result; } private int compileAppForModules(String[] javacOptions, --- 265,282 ---- return FileVisitResult.CONTINUE; } }); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ! System.out.println( ! "====================COMPILATION STARTS==========================="); ! System.out.println("compilation command for jars is " + newArgs); result = compiler.run(System.in, outputStream, System.err, newArgs.toArray(new String[newArgs.size()])); ! System.out.println( ! "===================COMPILATION ENDS==============================="); ! System.out.println(); } return result; } private int compileAppForModules(String[] javacOptions,
*** 315,349 **** argsList.add(Stream.of(classpath) .map(path -> path.toAbsolutePath().toString()) .collect(joining(File.pathSeparator))); } ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ! if(extension != null) { ! LOG.log(Level.INFO, ! "====================COMPILATION STARTS FOR "+extension+" ==========================="); ! LOG.log(Level.INFO, "compilation command for "+extension+" is "+argsList); ! } else { ! LOG.log(Level.INFO, "compilation command for modules is " + argsList); - } int tempResult = compiler.run(System.in, outputStream, System.err, argsList.toArray(new String[argsList.size()])); if (tempResult != 0) { result = tempResult; } String out = outputStream.toString(); if (!out.trim().isEmpty()) { LOG.log(Level.INFO, out); } ! if(extension != null) { ! LOG.log(Level.INFO, ! "===================COMPILATION ENDS FOR "+extension+ " =============================="); ! } else { ! LOG.log(Level.INFO, "===================COMPILATION ENDS==================="); ! } ! LOG.log(Level.INFO, "\n"); } return result; } public List<Path> getJarFilesList() throws IOException { --- 318,344 ---- argsList.add(Stream.of(classpath) .map(path -> path.toAbsolutePath().toString()) .collect(joining(File.pathSeparator))); } ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ! System.out.println( ! "====================COMPILATION STARTS==========================="); ! System.out.println( "compilation command for modules is " + argsList); int tempResult = compiler.run(System.in, outputStream, System.err, argsList.toArray(new String[argsList.size()])); if (tempResult != 0) { result = tempResult; } String out = outputStream.toString(); if (!out.trim().isEmpty()) { LOG.log(Level.INFO, out); } ! System.out.println( ! "===================COMPILATION ENDS==============================="); ! System.out.println(); } return result; } public List<Path> getJarFilesList() throws IOException {
*** 672,691 **** throw new RuntimeException(ex); } return ""; } ! public String getAllModuleNamesSeparatedByPathSeparator() { return getModuleTempSources().stream().map(Source::getModuleName) .collect(Collectors.joining(File.pathSeparator)); } - public String getAllModuleNamesSeparatedByComma() { - return getModuleTempSources().stream().map(Source::getModuleName) - .collect(Collectors.joining(",")); - } - public List<String> getAllModuleNamesAsList() { return getModuleTempSources().stream().map(Source::getModuleName) .collect(Collectors.toList()); } --- 667,681 ---- throw new RuntimeException(ex); } return ""; } ! public String addAllModules() { return getModuleTempSources().stream().map(Source::getModuleName) .collect(Collectors.joining(File.pathSeparator)); } public List<String> getAllModuleNamesAsList() { return getModuleTempSources().stream().map(Source::getModuleName) .collect(Collectors.toList()); }
< prev index next >