no message
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.CommonConstants;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Passes.PassException;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Compiler.CompilerType;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
import _VisualDVM.GlobalData.Module.Module;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import Common.Passes.PassException;
|
||||
import Common.Passes.Pass;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
@@ -41,6 +41,51 @@ public class Precompilation extends Pass<db_project_info> {
|
||||
protected Process process = null;
|
||||
protected String output = "";
|
||||
protected Vector<String> outputLines = new Vector<>();
|
||||
protected static void unpackPrecompilationMessages(db_project_info target, String text) throws Exception {
|
||||
boolean messageStarted = false;
|
||||
String messageFile = "";
|
||||
int messageLine = CommonConstants.Nan;
|
||||
int messageType = CommonConstants.Nan;
|
||||
Vector<String> messageText = new Vector<>();
|
||||
String[] nw = text.split("\n");
|
||||
for (String S : nw) {
|
||||
if (messageStarted) {
|
||||
String s = S.toLowerCase();
|
||||
if (s.startsWith("warning:")) {
|
||||
messageText.add(S.substring(9));
|
||||
messageType = 0;
|
||||
} else if (s.startsWith("error:")) {
|
||||
messageText.add(S.substring(7));
|
||||
messageType = 1;
|
||||
} else if (s.startsWith("note:")) {
|
||||
messageText.add(S.substring(6));
|
||||
messageType = 2;
|
||||
}
|
||||
if (messageType != CommonConstants.Nan) {
|
||||
target.db.files.Data.get(messageFile).CreateAndAddNewMessage(messageType, String.join("\n", messageText), messageLine, Constants.compiler_group);
|
||||
messageStarted = false;
|
||||
} else {
|
||||
if (!S.isEmpty())
|
||||
messageText.add(S);
|
||||
}
|
||||
} else {
|
||||
//анализ начала строки.
|
||||
for (String name : target.db.files.Data.keySet()) {
|
||||
if (S.startsWith(Utils_.toU(name))) {
|
||||
String[] data = S.split(":");
|
||||
if (data.length > 1) {
|
||||
messageFile = name;
|
||||
messageLine = Integer.parseInt(data[1]);
|
||||
messageType = CommonConstants.Nan;
|
||||
messageText = new Vector<>();
|
||||
messageStarted = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return true;
|
||||
@@ -60,7 +105,7 @@ public class Precompilation extends Pass<db_project_info> {
|
||||
}
|
||||
if (!(new File(makepath).exists())) {
|
||||
Log.Writeln_("Файла по пути к make.exe не существует.\n" +
|
||||
"Проверьте правильность его указания в глобальных настройках."+
|
||||
"Проверьте правильность его указания в глобальных настройках." +
|
||||
"\nПредварительная компиляция будет отключена.");
|
||||
Global.mainModule.getPass(PassCode.UpdateSetting).Do(SettingName.Precompilation, "0");
|
||||
return false;
|
||||
@@ -137,51 +182,6 @@ public class Precompilation extends Pass<db_project_info> {
|
||||
Global.mainModule.getFile().form.ShowNoAnalyses();
|
||||
}
|
||||
}
|
||||
protected static void unpackPrecompilationMessages(db_project_info target, String text) throws Exception {
|
||||
boolean messageStarted = false;
|
||||
String messageFile = "";
|
||||
int messageLine = CommonConstants.Nan;
|
||||
int messageType = CommonConstants.Nan;
|
||||
Vector<String> messageText = new Vector<>();
|
||||
String[] nw = text.split("\n");
|
||||
for (String S : nw) {
|
||||
if (messageStarted) {
|
||||
String s = S.toLowerCase();
|
||||
if (s.startsWith("warning:")) {
|
||||
messageText.add(S.substring(9));
|
||||
messageType = 0;
|
||||
} else if (s.startsWith("error:")) {
|
||||
messageText.add(S.substring(7));
|
||||
messageType = 1;
|
||||
} else if (s.startsWith("note:")) {
|
||||
messageText.add(S.substring(6));
|
||||
messageType = 2;
|
||||
}
|
||||
if (messageType != CommonConstants.Nan) {
|
||||
target.db.files.Data.get(messageFile).CreateAndAddNewMessage(messageType, String.join("\n", messageText), messageLine, Constants.compiler_group);
|
||||
messageStarted = false;
|
||||
} else {
|
||||
if (!S.isEmpty())
|
||||
messageText.add(S);
|
||||
}
|
||||
} else {
|
||||
//анализ начала строки.
|
||||
for (String name : target.db.files.Data.keySet()) {
|
||||
if (S.startsWith(Utils_.toU(name))) {
|
||||
String[] data = S.split(":");
|
||||
if (data.length > 1) {
|
||||
messageFile = name;
|
||||
messageLine = Integer.parseInt(data[1]);
|
||||
messageType = CommonConstants.Nan;
|
||||
messageText = new Vector<>();
|
||||
messageStarted = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
if (Utils_.isWindows()) {
|
||||
|
||||
Reference in New Issue
Block a user