void (final CompileScope scope) { try { CompilerTester tester = new CompilerTester(myProject, Arrays.asList(scope.getAffectedModules()), null); try { List<CompilerMessage> messages = tester.make(scope); for (CompilerMessage message : messages) { if (message.getCategory() == CompilerMessageCategory.ERROR) { fail("Compilation failed with error: " + message.getMessage()); } } } finally { tester.tearDown(); } } catch (Exception e) { ExceptionUtil.rethrow(e); } }