better error reporting in commandline compiler

This commit is contained in:
Stepan Koltsov
2012-01-06 21:22:50 +04:00
parent dba41c2e88
commit 430b973458
2 changed files with 19 additions and 7 deletions
@@ -120,7 +120,7 @@ public class CompileEnvironment {
rtJar = findActiveRtJar(failOnError);
if ((rtJar == null || !rtJar.exists())) {
throw new CompileEnvironmentException("No rt.jar found under JAVA_HOME=" + javaHome);
throw new CompileEnvironmentException("No JDK rt.jar found under JAVA_HOME=" + javaHome);
}
}
return rtJar;
@@ -337,7 +337,7 @@ public class CompileEnvironment {
}
}
public void compileBunchOfSources(String sourceFileOrDir, String jar, String outputDir, boolean includeRuntime) {
public boolean compileBunchOfSources(String sourceFileOrDir, String jar, String outputDir, boolean includeRuntime) {
CompileSession session = new CompileSession(myEnvironment);
session.addSources(sourceFileOrDir);
session.addStdLibSources(false);
@@ -350,7 +350,7 @@ public class CompileEnvironment {
}
}
if (!session.analyze(myErrorStream)) {
return;
return false;
}
ClassFileFactory factory = session.generate();
@@ -367,6 +367,7 @@ public class CompileEnvironment {
else {
throw new CompileEnvironmentException("Output directory or jar file is not specified - no files will be saved to the disk");
}
return true;
}
public static void writeToOutputDirectory(ClassFileFactory factory, final String outputDir) {