Do not try to compile if incorrect language/API version is passed

This commit is contained in:
Alexander Udalov
2017-07-05 21:06:47 +03:00
parent 4b42f9e071
commit eb673d6ed3
@@ -65,10 +65,13 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> extends CLI
CompilerConfiguration configuration = new CompilerConfiguration();
configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, groupingCollector);
setupCommonArgumentsAndServices(configuration, arguments, services);
setupPlatformSpecificArgumentsAndServices(configuration, arguments, services);
try {
setupCommonArgumentsAndServices(configuration, arguments, services);
setupPlatformSpecificArgumentsAndServices(configuration, arguments, services);
if (groupingCollector.hasErrors()) {
return ExitCode.COMPILATION_ERROR;
}
ExitCode exitCode = OK;
int repeatCount = 1;