Fix incorrectly updating csproj and not closing build issues file
This commit is contained in:
parent
ad0d87b4dd
commit
4e84478f4e
3 changed files with 38 additions and 31 deletions
|
@ -85,7 +85,7 @@ namespace GodotTools.ProjectEditor
|
||||||
void AddPropertyIfNotPresent(string name, string condition, string value)
|
void AddPropertyIfNotPresent(string name, string condition, string value)
|
||||||
{
|
{
|
||||||
if (root.PropertyGroups
|
if (root.PropertyGroups
|
||||||
.Any(g => g.Condition == string.Empty || g.Condition == condition &&
|
.Any(g => (g.Condition == string.Empty || g.Condition == condition) &&
|
||||||
g.Properties
|
g.Properties
|
||||||
.Any(p => p.Name == name &&
|
.Any(p => p.Name == name &&
|
||||||
p.Value == value &&
|
p.Value == value &&
|
||||||
|
|
|
@ -64,7 +64,7 @@ namespace GodotTools
|
||||||
|
|
||||||
private static string GetIssuesFilePath(MonoBuildInfo buildInfo)
|
private static string GetIssuesFilePath(MonoBuildInfo buildInfo)
|
||||||
{
|
{
|
||||||
return Path.Combine(Godot.ProjectSettings.LocalizePath(buildInfo.LogsDirPath), MsBuildIssuesFileName);
|
return Path.Combine(buildInfo.LogsDirPath, MsBuildIssuesFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void PrintVerbose(string text)
|
private static void PrintVerbose(string text)
|
||||||
|
|
|
@ -61,41 +61,48 @@ namespace GodotTools
|
||||||
{
|
{
|
||||||
using (var file = new Godot.File())
|
using (var file = new Godot.File())
|
||||||
{
|
{
|
||||||
Error openError = file.Open(csvFile, Godot.File.ModeFlags.Read);
|
try
|
||||||
|
|
||||||
if (openError != Error.Ok)
|
|
||||||
return;
|
|
||||||
|
|
||||||
while (!file.EofReached())
|
|
||||||
{
|
{
|
||||||
string[] csvColumns = file.GetCsvLine();
|
Error openError = file.Open(csvFile, Godot.File.ModeFlags.Read);
|
||||||
|
|
||||||
if (csvColumns.Length == 1 && csvColumns[0].Empty())
|
if (openError != Error.Ok)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (csvColumns.Length != 7)
|
while (!file.EofReached())
|
||||||
{
|
{
|
||||||
GD.PushError($"Expected 7 columns, got {csvColumns.Length}");
|
string[] csvColumns = file.GetCsvLine();
|
||||||
continue;
|
|
||||||
|
if (csvColumns.Length == 1 && csvColumns[0].Empty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (csvColumns.Length != 7)
|
||||||
|
{
|
||||||
|
GD.PushError($"Expected 7 columns, got {csvColumns.Length}");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var issue = new BuildIssue
|
||||||
|
{
|
||||||
|
Warning = csvColumns[0] == "warning",
|
||||||
|
File = csvColumns[1],
|
||||||
|
Line = int.Parse(csvColumns[2]),
|
||||||
|
Column = int.Parse(csvColumns[3]),
|
||||||
|
Code = csvColumns[4],
|
||||||
|
Message = csvColumns[5],
|
||||||
|
ProjectFile = csvColumns[6]
|
||||||
|
};
|
||||||
|
|
||||||
|
if (issue.Warning)
|
||||||
|
WarningCount += 1;
|
||||||
|
else
|
||||||
|
ErrorCount += 1;
|
||||||
|
|
||||||
|
issues.Add(issue);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
var issue = new BuildIssue
|
finally
|
||||||
{
|
{
|
||||||
Warning = csvColumns[0] == "warning",
|
file.Close(); // Disposing it is not enough. We need to call Close()
|
||||||
File = csvColumns[1],
|
|
||||||
Line = int.Parse(csvColumns[2]),
|
|
||||||
Column = int.Parse(csvColumns[3]),
|
|
||||||
Code = csvColumns[4],
|
|
||||||
Message = csvColumns[5],
|
|
||||||
ProjectFile = csvColumns[6]
|
|
||||||
};
|
|
||||||
|
|
||||||
if (issue.Warning)
|
|
||||||
WarningCount += 1;
|
|
||||||
else
|
|
||||||
ErrorCount += 1;
|
|
||||||
|
|
||||||
issues.Add(issue);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue