< prev index next >
functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/AppWrapper.java
Print this page
@@ -119,10 +119,11 @@
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,11 +199,11 @@
public int compileApp(String[] javacOptions, Path... classpath)
throws IOException {
return compileApp(javacOptions, null, classpath);
}
- public int compileAndCreateJavaExtensionProduct(ExtensionType extension, Path... classpath) throws IOException, ExecutionException {
+ 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,10 +230,11 @@
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,17 +265,18 @@
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);
+ 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()]));
- LOG.log(Level.INFO,
- "====================COMPILATION ENDS FOR NORMAL JAR=============================");
+ System.out.println(
+ "===================COMPILATION ENDS===============================");
+ System.out.println();
}
return result;
}
private int compileAppForModules(String[] javacOptions,
@@ -315,35 +318,27 @@
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,
+ 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);
}
- if(extension != null) {
- LOG.log(Level.INFO,
- "===================COMPILATION ENDS FOR "+extension+ " ==============================");
- } else {
- LOG.log(Level.INFO, "===================COMPILATION ENDS===================");
- }
- LOG.log(Level.INFO, "\n");
+ System.out.println(
+ "===================COMPILATION ENDS===============================");
+ System.out.println();
}
return result;
}
public List<Path> getJarFilesList() throws IOException {
@@ -672,20 +667,15 @@
throw new RuntimeException(ex);
}
return "";
}
- public String getAllModuleNamesSeparatedByPathSeparator() {
+ public String addAllModules() {
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());
}
< prev index next >