Fix handling errors when saving scripting API parsing cache
This commit is contained in:
@@ -164,6 +164,8 @@ namespace Flax.Build.Bindings
|
||||
|
||||
private static void SaveCache(ModuleInfo moduleInfo, BuildOptions moduleOptions, List<string> headerFiles)
|
||||
{
|
||||
if (!Directory.Exists(moduleOptions.IntermediateFolder))
|
||||
return;
|
||||
var path = GetCachePath(moduleInfo.Module, moduleOptions);
|
||||
using (var stream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read))
|
||||
using (var writer = new BinaryWriter(stream, Encoding.UTF8))
|
||||
|
||||
@@ -153,7 +153,15 @@ namespace Flax.Build.Bindings
|
||||
// Save cache
|
||||
using (new ProfileEventScope("SaveCache"))
|
||||
{
|
||||
SaveCache(moduleInfo, moduleOptions, headerFiles);
|
||||
try
|
||||
{
|
||||
SaveCache(moduleInfo, moduleOptions, headerFiles);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error($"Failed to save API cache for module {moduleInfo.Module.Name}");
|
||||
Log.Exception(ex);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize API
|
||||
|
||||
@@ -751,7 +751,9 @@ namespace Flax.Build
|
||||
using (new ProfileEventScope("BuildBindings"))
|
||||
{
|
||||
if (!buildData.Target.IsPreBuilt)
|
||||
{
|
||||
BuildTargetBindings(rules, graph, buildData);
|
||||
}
|
||||
}
|
||||
|
||||
// Link modules into a target
|
||||
|
||||
Reference in New Issue
Block a user