Improve build rules assembly cache to include build tool changes

This commit is contained in:
Wojciech Figat
2022-12-21 10:45:24 +01:00
parent 9a5c105db9
commit 6ff5dcfa50

View File

@@ -83,6 +83,14 @@ namespace Flax.Build
recentWriteTime = lastWriteTime;
}
// Include build tool version (eg. skip using cached assembly after editing build tool)
{
var executingAssembly = Assembly.GetExecutingAssembly();
DateTime lastWriteTime = File.GetLastWriteTime(executingAssembly.Location);
if (lastWriteTime > recentWriteTime)
recentWriteTime = lastWriteTime;
}
DateTime cacheTime = File.Exists(CachePath)
? DateTime.FromBinary(long.Parse(File.ReadAllText(CachePath)))
: DateTime.MinValue;