CompilerVM rebase fixes

This commit is contained in:
erri120 2019-11-11 19:09:52 +01:00 committed by Timothy Baldridge
parent 53b2dd5db1
commit 184c891995

View File

@ -202,7 +202,7 @@ namespace Wabbajack
var compiler = new VortexCompiler(args[1], args[2]); var compiler = new VortexCompiler(args[1], args[2]);
await Task.Run(() => await Task.Run(() =>
{ {
UIReady = false; Compiling = false;
try try
{ {
compiler.Compile(); compiler.Compile();
@ -214,53 +214,50 @@ namespace Wabbajack
} }
finally finally
{ {
UIReady = true; Compiling = true;
} }
}); });
}else{ }else{
if (this.Mo2Folder != null) Compiler compiler;
try {
compiler = new Compiler(this.Mo2Folder)
{ {
Compiler compiler; MO2Profile = this.MOProfile,
try { ModListName = this.ModListName,
compiler = new Compiler(this.Mo2Folder) ModListAuthor = this.AuthorText,
ModListDescription = this.Description,
ModListImage = this.ImagePath.TargetPath,
ModListWebsite = this.Website,
ModListReadme = this.ReadMeText.TargetPath,
};
}
catch (Exception ex)
{
while (ex.InnerException != null) ex = ex.InnerException;
Utils.Log($"Compiler error: {ex.ExceptionToString()}");
return;
}
await Task.Run(() =>
{
Compiling = true;
try
{ {
MO2Profile = this.MOProfile, compiler.Compile();
ModListName = this.ModListName, if (compiler.ModList?.ReportHTML != null)
ModListAuthor = this.AuthorText, {
ModListDescription = this.Description, this.HTMLReport = compiler.ModList.ReportHTML;
ModListImage = this.ImagePath.TargetPath, }
ModListWebsite = this.Website,
ModListReadme = this.ReadMeText.TargetPath,
};
} }
catch (Exception ex) catch (Exception ex)
{ {
while (ex.InnerException != null) ex = ex.InnerException; while (ex.InnerException != null) ex = ex.InnerException;
Utils.Log($"Compiler error: {ex.ExceptionToString()}"); Utils.Log($"Compiler error: {ex.ExceptionToString()}");
return;
} }
await Task.Run(() => finally
{ {
Compiling = true; Compiling = false;
try }
{ });
compiler.Compile();
if (compiler.ModList?.ReportHTML != null)
{
this.HTMLReport = compiler.ModList.ReportHTML;
}
}
catch (Exception ex)
{
while (ex.InnerException != null) ex = ex.InnerException;
Utils.Log($"Compiler error: {ex.ExceptionToString()}");
}
finally
{
Compiling = false;
}
});
}
} }
} }
} }