improved error reporting when JDK home is not defined

This commit is contained in:
Renaud Pawlak 2016-01-06 15:45:44 +01:00
parent 43e58e6b57
commit 4b3fcff2e6

View File

@ -78,6 +78,9 @@ public class JSweetCommandLineLauncher {
String classPath = jsapArgs.getString("classpath");
logger.info("classpath: " + classPath);
ErrorCountTranspilationHandler transpilationHandler = new ErrorCountTranspilationHandler(new ConsoleTranspilationHandler());
try {
File tsOutputDir = jsapArgs.getFile("tsout");
tsOutputDir.mkdirs();
logger.info("ts output dir: " + tsOutputDir);
@ -95,8 +98,6 @@ public class JSweetCommandLineLauncher {
LinkedList<File> files = new LinkedList<File>();
Util.addFiles(".java", inputDir, files);
ErrorCountTranspilationHandler transpilationHandler = new ErrorCountTranspilationHandler(new ConsoleTranspilationHandler());
try {
JSweetTranspiler transpiler = new JSweetTranspiler(tsOutputDir, jsOutputDir, classPath);
transpiler.setBundle(jsapArgs.getBoolean("bundle"));
@ -256,8 +257,7 @@ public class JSweetCommandLineLauncher {
// Ignore assertions
switchArg = new Switch("ignoreAssertions");
switchArg.setLongFlag("ignoreAssertions");
switchArg.setHelp(
"Set the transpiler to ignore 'assert' statements, i.e. no code is generated for assertions.");
switchArg.setHelp("Set the transpiler to ignore 'assert' statements, i.e. no code is generated for assertions.");
switchArg.setDefault("false");
jsap.registerParameter(switchArg);