import org.jetbrains.jps.ModuleChunk;
import org.jetbrains.jps.incremental.*;
import org.jetbrains.jps.incremental.java.JavaBuilder;
-import org.jetbrains.jps.incremental.messages.BuildMessage;
import org.jetbrains.jps.incremental.messages.CompilerMessage;
import org.jetbrains.jps.incremental.messages.FileGeneratedEvent;
import org.jetbrains.jps.incremental.messages.ProgressMessage;
successfullyCompiled = handler.getSuccessfullyCompiled();
- final List<CompilerMessage> messages = handler.getCompilerMessages();
- for (CompilerMessage message : messages) {
+ for (CompilerMessage message : handler.getCompilerMessages()) {
context.processMessage(message);
}
- boolean hasMessages = !messages.isEmpty();
-
- final StringBuffer unparsedBuffer = handler.getStdErr();
- if (unparsedBuffer.length() != 0) {
- context.processMessage(new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.INFO, unparsedBuffer.toString()));
- }
-
- final int exitValue = handler.getProcess().exitValue();
- if (!hasMessages && exitValue != 0) {
- context.processMessage(new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.ERROR, "Internal groovyc error: code " + exitValue));
- }
}
finally {
if (!myForStubs) {
}
public List<CompilerMessage> getCompilerMessages() {
- return compilerMessages;
+ ArrayList<CompilerMessage> messages = new ArrayList<CompilerMessage>(compilerMessages);
+ final StringBuffer unparsedBuffer = getStdErr();
+ if (unparsedBuffer.length() != 0) {
+ messages.add(new CompilerMessage("Groovyc", BuildMessage.Kind.INFO, unparsedBuffer.toString()));
+ }
+
+ final int exitValue = getProcess().exitValue();
+ if (messages.isEmpty() && exitValue != 0) {
+ messages.add(new CompilerMessage("Groovyc", BuildMessage.Kind.ERROR, "Internal groovyc error: code " + exitValue));
+ }
+
+ return messages;
}
public StringBuffer getStdErr() {
return myCompilerName;
}
+ @Nullable
public String getSourcePath() {
return mySourcePath;
}
toRecompile.add(vFile);
}
- final List<CompilerMessage> messages = processHandler.getCompilerMessages();
- for (CompilerMessage compilerMessage : messages) {
- final CompilerMessageCategory category = getMessageCategory(compilerMessage);
-
+ for (CompilerMessage compilerMessage : processHandler.getCompilerMessages()) {
final String url = compilerMessage.getSourcePath();
-
- compileContext.addMessage(category, compilerMessage.getMessageText(), VfsUtil.pathToUrl(FileUtil.toSystemIndependentName(url)),
+ compileContext.addMessage(getMessageCategory(compilerMessage), compilerMessage.getMessageText(),
+ url == null ? null : VfsUtil.pathToUrl(FileUtil.toSystemIndependentName(url)),
(int)compilerMessage.getLine(),
(int)compilerMessage.getColumn());
}
- boolean hasMessages = !messages.isEmpty();
-
- StringBuffer unparsedBuffer = processHandler.getStdErr();
- if (unparsedBuffer.length() != 0) {
- compileContext.addMessage(CompilerMessageCategory.INFORMATION, unparsedBuffer.toString(), null, -1, -1);
- }
-
- final int exitCode = processHandler.getProcess().exitValue();
- if (!hasMessages && exitCode != 0) {
- compileContext.addMessage(CompilerMessageCategory.ERROR, "Internal groovyc error: code " + exitCode, null, -1, -1);
- }
-
List<GroovycOSProcessHandler.OutputItem> outputItems = processHandler.getSuccessfullyCompiled();
ArrayList<OutputItem> items = new ArrayList<OutputItem>();
if (forStubs) {